/* ==========================================================================
   PCX Forum – Drei-Bereich-Ansicht
   Farben als Tokens, Dunkelmodus automatisch oder per data-theme.
   ========================================================================== */

:root {
    --bg: #eef1f5;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --text: #1b2230;
    --muted: #5d6779;
    --border: #d8dde6;
    --accent: #1f5fbf;
    --accent-text: #ffffff;
    --link: #1a56b0;
    --link-visited: #6b3fa8;
    --active: #e3edff;
    --active-border: #1f5fbf;
    --hover: #f1f5fc;
    --highlight: #b0430c;
    --quote-1: #2f7a4f;
    --quote-2: #9a5a00;
    --quote-3: #6b3fa8;
    --tree-line: #cfd6e2;
    --unread: #d9480f;
    --own-bg: #dff3e6;
    --error: #a61b1b;
    --error-bg: #fdecec;
    --shadow: 0 1px 2px rgb(16 24 40 / 6%);
    /* Das alte Logo ist weiss: auf hellem Grund mit Kontur */
    --logo-filter: drop-shadow(0 0 1px rgb(0 0 0 / 60%)) drop-shadow(0 1px 2px rgb(0 0 0 / 25%));

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size: 14px;
    --row: 1.65rem;
    --indent: 14px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1216;
        --own-bg: #1f3a2a;
        --surface: #171b21;
        --logo-filter: none;
        --surface-2: #1c2129;
        --text: #e4e8ef;
        --muted: #98a2b3;
        --border: #2a313c;
        --accent: #5b8def;
        --accent-text: #0b0e12;
        --link: #8ab4ff;
        --link-visited: #c2a3f5;
        --active: #1e2b44;
        --active-border: #5b8def;
        --hover: #1f252e;
        --highlight: #ff9d5c;
        --quote-1: #6fcf97;
        --quote-2: #f2c063;
        --quote-3: #c2a3f5;
        --tree-line: #333b47;
        --unread: #ff8a4c;
        --error: #ffb4b4;
        --error-bg: #3a1d1d;
        --shadow: none;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --own-bg: #1f3a2a;
    --logo-filter: none;
    --bg: #0f1216;
    --surface: #171b21;
    --surface-2: #1c2129;
    --text: #e4e8ef;
    --muted: #98a2b3;
    --border: #2a313c;
    --accent: #5b8def;
    --accent-text: #0b0e12;
    --link: #8ab4ff;
    --link-visited: #c2a3f5;
    --active: #1e2b44;
    --active-border: #5b8def;
    --hover: #1f252e;
    --highlight: #ff9d5c;
    --quote-1: #6fcf97;
    --quote-2: #f2c063;
    --quote-3: #c2a3f5;
    --tree-line: #333b47;
    --unread: #ff8a4c;
    --error: #ffb4b4;
    --error-bg: #3a1d1d;
    --shadow: none;
    color-scheme: dark;
}

/* ---------- Grundlayout ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font: var(--font-size)/1.45 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Kopfzeile ---------- */

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .45rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

.brand {
    flex: none;
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    margin: -.15rem 0;
}
.brand img { display: block; width: 100%; height: 100%; }
.brand:hover { text-decoration: none; filter: brightness(1.08) drop-shadow(0 0 3px rgba(255, 255, 255, .25)); }

.board-name { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.board-name strong { font-size: 1.05rem; }
.board-desc { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topnav { display: flex; gap: 1.1rem; margin-left: auto; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
}
.icon-btn:hover { background: var(--hover); }

.btn-link {
    padding: .5rem 0;
    border: 0;
    background: none;
    color: var(--link);
    font: inherit;
    cursor: pointer;
}

/* ---------- Drei Bereiche ---------- */

.panes {
    display: grid;
    grid-template-rows: var(--h-threads, 34%) 7px var(--h-thread, 26%) 7px minmax(0, 1fr);
    min-height: 0;
    padding: .5rem;
    gap: 0;
}

.pane {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    scrollbar-gutter: stable;
}

.splitter {
    cursor: row-resize;
    position: relative;
    touch-action: none;
}
.splitter::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42px;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    transform: translate(-50%, -50%);
}
.splitter:hover::after, .splitter:focus-visible::after { background: var(--accent); }

.pane-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 2.3rem;
    padding: .3rem .75rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.pane-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pane-sub { color: var(--muted); white-space: nowrap; margin-left: auto; font-size: .85rem; }
.pane-empty { margin: 0; padding: 1rem .9rem; color: var(--muted); }
.back { display: none; }

.is-highlight { color: var(--highlight); font-weight: 600; }

/* ---------- Threadliste ---------- */

.threadlist {
    list-style: none;
    margin: 0;
    padding: .2rem 0;
}

.threadlist > li.t {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9rem 6.8rem 3.2rem 6.8rem;
    align-items: baseline;
    gap: .75rem;
    padding: 0 .75rem;
    min-height: var(--row);
    border-left: 3px solid transparent;
}
.threadlist > li.t:hover { background: var(--hover); }
.threadlist > li.is-active { background: var(--active); border-left-color: var(--active-border); }

.t-subject { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: .2rem 0; }
.t-subject:visited { color: var(--link-visited); }
.t-author { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-date, .t-last { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; white-space: nowrap; }
.t-replies { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.is-fixed .t-subject { font-weight: 650; }
.is-fixed .t-subject::before { content: "📌 "; }
.is-closed .t-subject::after { content: " 🔒"; font-size: .8em; }

.threadlist > li.more { padding: 0 .75rem; }

/* ---------- Thread-Baum ---------- */

.tree {
    list-style: none;
    margin: 0;
    padding: .25rem 0 .5rem;
}

.tree > li {
    /* Einrückung begrenzen: sehr tiefe Ketten laufen nicht aus dem Bild */
    --i: calc(min(var(--d), 32) * var(--indent));
    padding: .12rem .75rem .12rem calc(.75rem + var(--i));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid transparent;
    /* Hilfslinien der Baumstruktur */
    background-image: repeating-linear-gradient(to right, var(--tree-line) 0 1px, transparent 1px var(--indent));
    background-position: calc(.75rem + 4px) 0;
    background-size: var(--i) 100%;
    background-repeat: no-repeat;
}
.tree > li:hover { background-color: var(--hover); }
.tree > li.is-active { background-color: var(--active); border-left-color: var(--active-border); }
.tree > li:first-child > a { font-weight: 650; }
.tree a:visited { color: var(--link-visited); }
.tree .n-author { margin-left: .35rem; }
.tree time { margin-left: .35rem; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* ---------- Nachricht ---------- */

.msg { padding: .75rem 1rem 1rem; }
.msg-meta { margin: 0 0 .75rem; color: var(--muted); }
.msg-author { color: var(--text); font-weight: 600; }

.msg-body {
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.msg-body img { max-width: 100%; height: auto; }
.msg-img { display: inline-block; margin: .25rem 0; }
.msg-img img { display: block; max-height: 70vh; border-radius: 4px; }
.msg-video { display: block; max-width: 100%; max-height: 60vh; margin: .25rem 0; }


.msg-steam {
    display: flex;
    max-width: 620px;
    margin: .35rem 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
}
.msg-steam:hover { border-color: var(--accent); text-decoration: none; }
.msg-steam img { flex: none; width: 230px; height: auto; aspect-ratio: 460 / 215; object-fit: cover; background: #1b2838; }
.msg-steam-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; padding: .55rem .75rem; }
.msg-steam-body strong { line-height: 1.3; }
.msg-steam-desc {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.4;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.msg-steam-meta { margin-top: auto; color: var(--link); font-size: .82rem; font-weight: 600; }
@media (max-width: 560px) {
    .msg-steam { flex-direction: column; }
    .msg-steam img { width: 100%; }
}

.msg-yt {
    position: relative;
    display: inline-block;
    max-width: 480px;
    width: 100%;
    margin: .25rem 0;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}
.msg-yt img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .9; }
.msg-yt-play {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 64px;
    height: 44px;
    border-radius: 10px;
    background: #e00;
    transform: translate(-50%, -50%);
}
.msg-yt-play::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 54%;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
    transform: translate(-50%, -50%);
}
.msg-placeholder { color: var(--muted); font-style: italic; }

.msg-actions {
    display: flex;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: .6rem;
    border-top: 1px solid var(--border);
}

/* ---------- Beitragsinhalt (Markdown) ---------- */

.msg-body > :first-child { margin-top: 0; }
.msg-body > :last-child { margin-bottom: 0; }
.msg-body p { margin: 0 0 .8em; }
.msg-body h1, .msg-body h2, .msg-body h3, .msg-body h4, .msg-body h5, .msg-body h6 {
    margin: 1.1em 0 .4em;
    font-size: 1.05em;
    line-height: 1.3;
}
.msg-body h1 { font-size: 1.3em; }
.msg-body h2 { font-size: 1.18em; }
.msg-body ul, .msg-body ol { margin: 0 0 .8em; padding-left: 1.5em; }
.msg-body li > p { margin: 0; }
.msg-body hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
.msg-body code {
    padding: .1em .3em;
    border-radius: 4px;
    background: var(--surface-2);
    font: .9em ui-monospace, "Cascadia Code", Consolas, monospace;
}
.msg-body pre {
    margin: 0 0 .8em;
    padding: .6rem .8rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
}
.msg-body pre code { padding: 0; background: none; }
.msg-body blockquote {
    margin: 0 0 .8em;
    padding: .1em 0 .1em .8rem;
    border-left: 3px solid var(--quote-1);
    color: var(--quote-1);
}
.msg-body blockquote blockquote { border-left-color: var(--quote-2); color: var(--quote-2); }
.msg-body blockquote blockquote blockquote { border-left-color: var(--quote-3); color: var(--quote-3); }
.msg-body blockquote p { margin-bottom: .4em; }

.msg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    max-width: 640px;
    margin: 0 0 .8em;
}
.msg-gallery-item { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--surface-2); }
.msg-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .15s; }
.msg-gallery-item:hover img { transform: scale(1.04); }

.msg-member {
    margin: 0 0 .8em;
    padding: .5rem .75rem;
    border: 1px dashed var(--accent);
    border-radius: 6px;
}
.msg-member > :last-child { margin-bottom: 0; }
.msg-spoiler {
    margin: 0 0 .8em;
    padding: .4rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
}
.msg-spoiler > summary { cursor: pointer; font-weight: 600; }
.msg-spoiler[open] > summary { margin-bottom: .4rem; }
.msg-giveaway {
    margin: 0 0 .8em;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
}
.msg-giveaway .giveaway-title { margin: 0 0 .3rem; font-weight: 650; }
.msg-giveaway ul { list-style: none; margin: 0; padding: 0; }
.msg-giveaway li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .2rem 0; }
.msg-giveaway li.is-claimed { color: var(--muted); }
.msg-giveaway .btn-small { margin-left: 0; }
.giveaway-by { font-size: .85rem; }
.msg-yt.is-playing { display: block; aspect-ratio: 16 / 9; }
.msg-yt iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- WYSIWYG-Editor ---------- */

[data-toolbar="wysiwyg"] { display: none; }
.compose.is-wysiwyg [data-toolbar="wysiwyg"] { display: flex; }
.compose.is-wysiwyg [data-toolbar="source"],
.compose.is-wysiwyg textarea[name="body"],
.compose.is-wysiwyg .compose-preview { display: none; }
.compose-toolbar button[aria-pressed="true"] { background: var(--active); color: var(--accent); }

.ed-content {
    min-height: 14rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    background: var(--surface);
    outline: none;
}
.ed-content:focus { box-shadow: 0 0 0 2px var(--accent); }
.ed-content p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    height: 0;
    color: var(--muted);
    pointer-events: none;
}
.ed-content img { max-width: 100%; max-height: 300px; border-radius: 4px; vertical-align: bottom; }
.ed-content img.ProseMirror-selectednode { outline: 3px solid var(--accent); }
.ed-content a { pointer-events: none; }
.ed-container {
    position: relative;
    margin: 0 0 .8em;
    padding: 1.5rem .75rem .5rem;
    border: 1px dashed var(--accent);
    border-radius: 6px;
}
.ed-container::before {
    content: attr(data-caption);
    position: absolute;
    top: .3rem;
    left: .75rem;
    color: var(--accent);
    font-size: .75rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ed-container[data-container="spoiler"] { border-color: var(--muted); }
.ed-container[data-container="spoiler"]::before { color: var(--muted); }
.ed-embed, .ed-giveaway {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 .8em;
    padding: .5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: default;
}
.ed-embed img { width: 120px; height: auto; border-radius: 4px; }
.ed-embed-url { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.ed-giveaway { flex-direction: column; align-items: flex-start; gap: .25rem; }
.ed-giveaway ul { margin: 0; padding-left: 1.2rem; font-family: ui-monospace, Consolas, monospace; }
.ed-embed.ProseMirror-selectednode, .ed-giveaway.ProseMirror-selectednode { outline: 2px solid var(--accent); }
/* ---------- Suche ---------- */

/* Während der Suche bekommt der obere Bereich mehr Platz */
.panes:has(#pane-threads .search-form) {
    grid-template-rows: minmax(0, 52%) 7px minmax(0, 20%) 7px minmax(0, 1fr);
}

.search-form { display: grid; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.search-main { display: flex; gap: .5rem; }
.search-main input {
    flex: 1;
    min-width: 0;
    padding: .45rem .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 15px;
}
.search-main input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.search-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); }
.search-filters input[type="text"], .search-filters select {
    padding: .2rem .35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.search-filters .check { margin: 0; gap: .3rem; }
.search-summary { margin: 0; padding: .5rem .75rem 0; font-size: .85rem; }
.search-hits { list-style: none; margin: 0; padding: .25rem 0 .5rem; }
.search-hits li { padding: .45rem .75rem; border-bottom: 1px solid var(--border); }
.search-hits li:hover { background: var(--hover); }
.hit-subject { font-weight: 600; }
.hit-meta { display: block; color: var(--muted); font-size: .8rem; }
.hit-excerpt { margin: .2rem 0 0; font-size: .88rem; line-height: 1.45; }
.search-hits mark { background: color-mix(in srgb, var(--unread) 25%, transparent); color: inherit; border-radius: 2px; padding: 0 .1em; }
.search-pages { display: flex; justify-content: center; gap: 1.2rem; padding: .6rem; }
/* ---------- Bildansicht ---------- */

.lightbox {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(0 0 0 / 92%);
    color: #fff;
}
.lightbox::backdrop { background: rgb(0 0 0 / 70%); }
.lightbox-img { position: absolute; inset: 3rem 3.5rem; display: grid; place-items: center; }
.lightbox-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
    position: absolute;
    border: 0;
    background: rgb(255 255 255 / 12%);
    color: #fff;
    font-size: 1.6rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    cursor: pointer;
}
.lightbox button:hover { background: rgb(255 255 255 / 25%); }
.lightbox .lb-close { top: .5rem; right: .5rem; }
.lightbox .lb-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: .75rem; left: 50%; transform: translateX(-50%); font-size: .9rem; opacity: .8; }
.lightbox .lb-open { position: absolute; bottom: .6rem; right: .75rem; color: #fff; font-size: .85rem; opacity: .8; }

/* ---------- Ungelesen ---------- */

.threadlist > li.is-unread .t-subject { font-weight: 650; }
.threadlist > li.is-unread .t-subject::before,
.tree > li.is-new > a::before {
    content: "";
    display: inline-block;
    width: .5em;
    height: .5em;
    margin-right: .4em;
    border-radius: 50%;
    background: var(--unread);
    vertical-align: .1em;
}
.threadlist > li.is-fixed.is-unread .t-subject::before { content: "📌 "; width: auto; height: auto; background: none; }
.tree > li.is-new > a { font-weight: 650; }
.new-count { color: var(--unread); font-weight: 600; }

/* Angemeldet: Die Linkfarbe zeigt gelesen/ungelesen, nicht den Verlauf des Browsers –
   sonst wäre ein Thread mit neuen Antworten noch «besucht» gefärbt */
.has-read-state .t-subject:visited,
.has-read-state .tree a:visited { color: var(--link); }
.has-read-state .threadlist > li.t:not(.is-unread) .t-subject,
.has-read-state .tree > li:not(.is-new) > a { color: var(--link-visited); }

/* ---------- Eigene Beiträge ---------- */

.threadlist > li.is-own .t-author,
.tree > li.is-own > .n-author,
.msg.is-own .msg-author { padding: 0 .35em; border-radius: 4px; background: var(--own-bg); }
.threadlist > li.is-own .t-author { justify-self: start; max-width: 100%; box-sizing: border-box; }

.btn-small {
    flex: none;
    margin-left: auto;
    padding: .2rem .55rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
}
.btn-small:hover { background: var(--hover); }
.pane-sub + .btn-small { margin-left: 0; }

.user-name { font-weight: 600; }

/* ---------- Formulare (Login, Registrierung, Passwort) ---------- */

.page-center {
    display: grid;
    place-items: start center;
    padding: 3rem 16px;
    overflow: auto;
}
.card {
    width: min(100%, 24rem);
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.card h1 { margin: 0 0 1rem; font-size: 1.25rem; }
.field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.field > span:first-child { font-weight: 600; font-size: .9rem; }
.field input {
    padding: .55rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 16px; /* verhindert Zoom auf iOS */
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.1rem; }
.btn {
    width: 100%;
    padding: .6rem 1rem;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-text);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.form-error {
    margin: 0 0 1rem;
    padding: .6rem .75rem;
    border-radius: 6px;
    background: var(--error-bg);
    color: var(--error);
}
.form-note { margin: 1rem 0 0; color: var(--muted); font-size: .85rem; }
.card p { margin: 0 0 1rem; line-height: 1.5; }
.card p.form-note { margin: 1rem 0 0; }
a.btn { display: block; box-sizing: border-box; text-align: center; text-decoration: none; }
.form-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin: 1rem 0 0 !important; font-size: .9rem; }
.field-hint { color: var(--muted); font-size: .8rem; }
.field-error { color: var(--error); font-size: .85rem; font-weight: 600; }
.field.has-error input { border-color: var(--error); }
/* Passwort mit «Anzeigen»-Knopf im Feld */
.password-input { position: relative; display: grid; }
.password-input input { padding-right: 5.5rem; }
.password-toggle {
    position: absolute;
    inset: 4px 4px 4px auto;
    padding: 0 .6rem;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
}
.password-toggle:hover { background: var(--hover); }
/* Falle für Bots: für Menschen unsichtbar, auch für Screenreader */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Schreiben ---------- */

/* Beim Schreiben bekommt der Nachrichtenbereich den meisten Platz */
.panes:has(#pane-message form.compose) {
    grid-template-rows: minmax(0, 18%) 7px minmax(0, 14%) 7px minmax(0, 1fr);
}

.compose { display: grid; gap: .25rem; padding: .75rem 1rem 1.25rem; }
.compose .field { margin-bottom: .6rem; }
.compose textarea {
    width: 100%;
    min-height: 12rem;
    padding: .6rem .7rem;
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    background: var(--surface-2);
    color: var(--text);
    font: 15px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace;
    resize: vertical;
}
.compose textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.compose-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: var(--surface);
}
.compose-toolbar button {
    min-width: 2rem;
    padding: .2rem .5rem;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
}
.compose-toolbar button:hover { background: var(--hover); }
.compose-toolbar .sep { width: 1px; margin: .2rem .25rem; background: var(--border); }
.compose-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; margin-top: .25rem; }
.compose-actions .hint { color: var(--muted); font-size: .8rem; }
.btn-inline { width: auto; padding-inline: 1.4rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.form-error p { margin: 0; }
.form-error p + p { margin-top: .3rem; }
.draft-note {
    margin: 0 0 .5rem;
    padding: .45rem .7rem;
    border-radius: 6px;
    background: var(--active);
    font-size: .9rem;
}
.compose-preview { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--border); }
.compose-preview h3 { margin: 0 0 .5rem; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.preview-subject { margin: 0 0 .5rem; font-weight: 650; }
.muted { color: var(--muted); }

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    z-index: 10;
    max-width: min(90vw, 32rem);
    padding: .65rem 1rem;
    border-radius: 8px;
    background: var(--text);
    color: var(--surface);
    box-shadow: 0 6px 24px rgb(0 0 0 / 25%);
    transform: translateX(-50%);
}

/* ---------- Profile, Konto, Online-Liste ---------- */

.card-wide { width: min(100%, 44rem); }
.card.admin { width: min(100%, 84rem); }
.card h2 { margin: 0 0 .75rem; font-size: 1.05rem; }
.pane-page { padding: .9rem 1rem 1.5rem; }
.pane-page .profile-name { font-size: 1.2rem; }
.pane-page h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.pane-page p { margin: 0 0 .9rem; }

.user-link { color: inherit; font-weight: 600; }
.user-link:hover { color: var(--accent); }
.online-link .count {
    display: inline-block;
    min-width: 1.4em;
    padding: 0 .35em;
    border-radius: 999px;
    background: var(--active);
    font-size: .8rem;
    text-align: center;
}

.avatar { display: block; flex: none; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.avatar-empty {
    display: grid;
    place-items: center;
    width: var(--size, 96px);
    height: var(--size, 96px);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: calc(var(--size, 96px) * .42);
    font-weight: 700;
}

.profile-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.25rem; }
.profile-name { margin: 0 0 .4rem; font-size: 1.35rem; overflow-wrap: anywhere; }
.profile-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; }
.profile-stats dt { color: var(--muted); font-size: .8rem; }
.profile-stats dd { margin: 0; font-weight: 600; }
.profile-fields { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .45rem 1.2rem; margin: 0 0 1.25rem; }
.profile-fields > div { display: contents; }
.profile-fields dt { color: var(--muted); }
.profile-fields dd { margin: 0; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; margin: 0; }
.badge { display: inline-block; margin: 0 0 .4rem; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; }
.badge-muted { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.muted { color: var(--muted); }

.online-list, .member-list { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.member-list { display: grid; gap: .3rem; }
.online-search-title { margin-top: 1.5rem !important; }
.member-search input {
    width: min(100%, 20rem);
    padding: .5rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}
#member-results { margin-top: .75rem; }

.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: .3rem .7rem; border-radius: 6px; color: var(--text); }
.tabs a:hover { background: var(--hover); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--active); font-weight: 600; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); align-items: start; gap: 0 1rem; margin-bottom: .5rem; }
.field-wide { grid-column: 1 / -1; }
.field textarea {
    padding: .55rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.avatar-field { display: flex; gap: 1rem; align-items: center; margin: 0 0 1.25rem; padding: 0; border: 0; }
.avatar-field legend { margin-bottom: .5rem; padding: 0; font-weight: 600; font-size: .9rem; }
.avatar-controls { display: grid; gap: .35rem; }
.avatar-controls .check { margin: .2rem 0 0; }
.settings-section { padding: 1rem 0 1.25rem; border-top: 1px solid var(--border); }
.settings-section:first-of-type { border-top: 0; padding-top: 0; }
.settings-section .field { max-width: 24rem; }

/* Menü-Knopf nur auf dem Handy */
.menu-btn { display: none; }

/* ---------- Private Nachrichten (Chat) ---------- */

.pm-link .count, .conversation .count {
    display: inline-block;
    min-width: 1.4em;
    padding: 0 .35em;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .75rem;
    font-weight: 700;
    text-align: center;
}
.btn-small-inline { width: auto; padding: .35rem .9rem; font-size: .9rem; }

.messenger {
    display: grid;
    grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
    gap: .5rem;
    min-height: 0;
    padding: .5rem;
}
.conversations, .chat-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.conversations-head { padding: .75rem .75rem .5rem; border-bottom: 1px solid var(--border); }
.conversations-head h1 { margin: 0 0 .5rem; font-size: 1.1rem; }
.new-chat { position: relative; }
.new-chat input {
    box-sizing: border-box;
    width: 100%;
    padding: .45rem .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}
.new-chat-list {
    position: absolute;
    inset: calc(100% + 4px) 0 auto;
    z-index: 5;
    margin: 0;
    padding: .3rem;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
}
.new-chat-list a, .new-chat-list .muted { display: block; padding: .4rem .5rem; border-radius: 4px; }
.new-chat-list a:hover { background: var(--hover); text-decoration: none; }
.new-chat-list:empty { display: none; }

.conversation-list { flex: 1; min-height: 0; margin: 0; padding: .25rem; overflow: auto; list-style: none; overscroll-behavior: contain; }
.conversation {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem;
    border-radius: 8px;
    color: var(--text);
}
.conversation:hover { background: var(--hover); text-decoration: none; }
.conversation.is-active { background: var(--active); }
.conversation .avatar { border-radius: 50%; }
.conversation-text { display: grid; flex: 1; min-width: 0; }
.conversation-top { display: flex; justify-content: space-between; gap: .5rem; }
.conversation-top strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-top time { flex: none; color: var(--muted); font-size: .8rem; }
.conversation-preview { overflow: hidden; color: var(--muted); font-size: .88rem; white-space: nowrap; text-overflow: ellipsis; }
.conversation.is-unread .conversation-preview { color: var(--text); font-weight: 600; }
.conversation-empty { padding: 1rem .75rem; color: var(--muted); }

.chat-placeholder { margin: auto; padding: 2rem; color: var(--muted); text-align: center; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-bottom: 1px solid var(--border); }
.chat-head .avatar { border-radius: 50%; }
.chat-head .back { display: none; }
.chat-title { flex: 1; margin: 0; font-size: 1rem; }
.chat-delete { border: 0; background: none; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; }
.chat-delete:hover { color: var(--error); }

.chat-scroll { flex: 1; min-height: 0; padding: .75rem .9rem; overflow: auto; overscroll-behavior: contain; background: var(--bg); }
.chat-messages { display: flex; flex-direction: column; gap: .35rem; }
.chat-older { align-self: center; margin-bottom: .5rem; padding: .3rem .8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.chat-empty { margin: 2rem auto; color: var(--muted); }
.chat-day { align-self: center; margin: .75rem 0 .35rem; padding: .1rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .78rem; }

.bubble {
    position: relative;
    max-width: min(75%, 42rem);
    padding: .45rem .7rem .3rem;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow-wrap: anywhere;
}
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.mine { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--active); border-color: transparent; }
.bubble-topic { margin: 0 0 .2rem; color: var(--muted); font-size: .78rem; font-weight: 600; }
.bubble-body { font-size: 15px; line-height: 1.5; }
.bubble-body > :first-child { margin-top: 0; }
.bubble-body > :last-child { margin-bottom: 0; }
.bubble-body p { margin: 0 0 .5em; }
.bubble-body blockquote { margin: .2em 0 .5em; padding: .1em .6em; border-left: 3px solid var(--border); color: var(--muted); }
.bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.bubble-delete { padding: 0 .2rem; border: 0; background: none; color: inherit; font: inherit; font-size: .9rem; line-height: 1; cursor: pointer; opacity: 0; }
.bubble:hover .bubble-delete, .bubble-delete:focus-visible { opacity: 1; }
@media (hover: none) { .bubble-delete { opacity: .6; } }
.chat-seen { min-height: 1em; margin: .2rem 0 0; color: var(--muted); font-size: .75rem; text-align: right; }

.chat-composer { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem .75rem .3rem; border-top: 1px solid var(--border); }
.chat-composer textarea {
    flex: 1;
    min-height: 2.4rem;
    max-height: 40vh;
    padding: .5rem .7rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    resize: none;
}
.chat-composer textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.chat-composer .btn { border-radius: 18px; }
.chat-hint { margin: 0; padding: 0 .9rem .5rem; color: var(--muted); font-size: .75rem; }
.chat-readonly { padding: .75rem .9rem; border-top: 1px solid var(--border); }

@media (max-width: 720px) {
    .messenger { grid-template-columns: minmax(0, 1fr); padding: 0; }
    .conversations, .chat-pane { border: 0; border-radius: 0; }
    .messenger[data-view="list"] .chat-pane, .messenger[data-view="chat"] .conversations { display: none; }
    .chat-head .back { display: inline-grid; }
    .bubble { max-width: 85%; }
    .chat-hint { display: none; }
}

/* ---------- Moderation und Verwaltung ---------- */

.mod-menu { position: relative; display: inline-block; }
.mod-menu-toggle { padding: 0; border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; }
.mod-menu-toggle::after { content: " ▾"; font-size: .75em; }
/* Popover: liegt über allen Bereichen, wird nicht abgeschnitten (Position setzt forum.js) */
.mod-menu-items {
    position: fixed;
    inset: auto;
    margin: 0;
    display: none;
    gap: 2px;
    min-width: 15rem;
    padding: .35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.mod-menu-thread { margin-left: auto; font-size: .85rem; }
.mod-menu-items:popover-open { display: grid; }
.mod-menu-items button, .mod-menu-items a {
    display: block;
    padding: .45rem .6rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mod-menu-items button:hover, .mod-menu-items a:hover { background: var(--hover); text-decoration: none; }
.mod-move { display: flex; align-items: center; gap: .4rem; padding: .3rem .6rem; }
.mod-move select { font: inherit; }
.danger, .mod-menu-items .danger { color: var(--error); }
.btn.danger { background: var(--error); color: #fff; }

.admin h2 { margin: 1.25rem 0 .6rem; font-size: 1.05rem; }
.admin .tabs .count, .pm-link .count { margin-left: .2rem; }
.tabs .count {
    display: inline-block;
    min-width: 1.3em;
    padding: 0 .3em;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .72rem;
    text-align: center;
}
.admin-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.admin-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.admin-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; }
.decline > summary { padding: .35rem .7rem; color: var(--error); cursor: pointer; }
.decline-form { display: grid; gap: .4rem; min-width: 16rem; margin-top: .4rem; }
.admin-log { margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.admin-log li { padding: .35rem 0; border-top: 1px solid var(--border); }
.admin-log time { color: var(--muted); margin-right: .4rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.stat-tiles > div { padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.stat-tiles dt { color: var(--muted); font-size: .8rem; }
.stat-tiles dd { margin: .2rem 0 0; font-size: 1.4rem; font-weight: 700; }
.notice { padding: .6rem .75rem; border-radius: 6px; background: var(--active); }
.admin-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.admin-filter input, .admin-filter select, .admin select, .field select {
    padding: .45rem .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}
.admin-filter input { flex: 1; min-width: 12rem; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: .45rem .5rem; border-top: 1px solid var(--border); text-align: left; white-space: nowrap; }
.admin-table th { color: var(--muted); font-weight: 600; border-top: 0; }
.pager { display: flex; justify-content: space-between; margin-top: 1rem; }
.checks { margin: 0 0 1rem; padding: 0; border: 0; }
.checks legend { margin-bottom: .4rem; padding: 0; font-weight: 600; font-size: .9rem; }
.checks .check { margin-bottom: .35rem; }
.board-item > summary, .settings-section > summary { cursor: pointer; padding: .2rem 0; }
.board-form { margin-top: .75rem; }
.history { margin: 0; padding: 0; list-style: none; }
.history > li { padding: .75rem 0; border-top: 1px solid var(--border); }
.history-meta { margin: 0 0 .2rem; color: var(--muted); font-size: .85rem; }
.history-subject { margin: 0 0 .4rem; font-weight: 600; }

/* ---------- Benachrichtigungen, Abos, @-Vorschläge ---------- */

.bell-wrap { display: inline-flex; }
.bell { position: relative; }
.bell.has-unread { color: var(--accent); border-color: var(--accent); }
.bell-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 1.2rem;
    padding: 0 .25rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.2rem;
    text-align: center;
}
.notif-pop {
    position: fixed;
    inset: auto;
    width: min(24rem, calc(100vw - 16px));
    max-height: min(70vh, 32rem);
    margin: 0;
    padding: 0;
    overflow: auto;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.notif-list { margin: 0; padding: .25rem; list-style: none; }
.notif-list a { display: grid; gap: .1rem; padding: .5rem .6rem; border-radius: 6px; color: var(--text); }
.notif-list a:hover { background: var(--hover); text-decoration: none; }
.notif-list .is-unread a { background: var(--active); }
.notif-title { overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.notif-list time { color: var(--muted); font-size: .78rem; }
.notif-empty { margin: 0; padding: 1rem .9rem; color: var(--muted); }
.notif-foot { margin: 0; padding: .45rem .75rem; border-top: 1px solid var(--border); font-size: .85rem; }
.notif-page .notif-head { padding: 0 0 .6rem; }

.subscribe.is-on { border-color: var(--accent); }

.mention-box {
    position: fixed;
    z-index: 50;
    min-width: 12rem;
    max-width: 20rem;
    margin: 0;
    padding: .25rem;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.mention-box li { padding: .35rem .55rem; border-radius: 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-box li[aria-selected="true"], .mention-box li:hover { background: var(--active); }

/* ---------- Testsystem ---------- */

.env-badge {
    position: relative;
    flex: none;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: #d97706;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    cursor: help;
}
.env-badge-text {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    display: none;
    width: min(22rem, 80vw);
    padding: .6rem .75rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid #d97706;
    box-shadow: var(--shadow);
    color: var(--text);
    font-weight: 400;
    font-size: .85rem;
    line-height: 1.45;
}
.env-badge:hover .env-badge-text, .env-badge:focus .env-badge-text { display: block; }
.topbar:has(.env-badge) { border-bottom: 2px solid #d97706; }

/* ---------- Boards: Auswahl und Übersicht ---------- */

.board-switch { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .45rem; margin-left: -.45rem; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 1.05rem; cursor: pointer; }
.board-switch::after { content: "▾"; color: var(--muted); font-size: .8em; }
.board-switch:hover { background: var(--hover); }
.board-pop {
    position: fixed;
    inset: auto;
    margin: 0;
    width: min(22rem, calc(100vw - 16px));
    padding: .35rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.board-pop:popover-open { display: grid; gap: 2px; }
.board-pop a { display: grid; gap: .1rem; padding: .5rem .6rem; border-radius: 6px; color: var(--text); }
.board-pop a:hover { background: var(--hover); text-decoration: none; }
.board-pop a[aria-current="page"] { background: var(--active); }
.board-pop small { color: var(--muted); }
.board-pop .board-pop-all { margin-top: .2rem; border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; color: var(--link); font-size: .9rem; }

.boards-head { margin: 0 0 .75rem; line-height: 0; }
.boards-head img { max-width: 100%; height: auto; filter: var(--logo-filter); }
.brand img { filter: var(--logo-filter); }

.board-list { margin: 0; padding: 0; list-style: none; }
.board-list > li { display: grid; gap: .35rem; padding: .9rem 0; border-top: 1px solid var(--border); }
.board-list > li:first-child { border-top: 0; }
.board-link { display: grid; gap: .2rem; color: var(--text); }
.board-link:hover { text-decoration: none; }
.board-link:hover strong { color: var(--accent); }
.board-title { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; }
.board-title .count { padding: 0 .45rem; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .75rem; font-weight: 700; }
.board-text { color: var(--muted); }
.board-stats { color: var(--muted); font-size: .88rem; }

/* ---------- Ladezustand ---------- */

.htmx-request.pane, .pane:has(> .htmx-request) { opacity: .75; transition: opacity .15s .1s; }

/* ---------- Mobile: ein Bereich zur Zeit ---------- */

@media (max-width: 720px) {
    :root { --font-size: 15px; --row: 2.6rem; --indent: 10px; }

    .topbar { gap: .6rem; padding: .4rem 16px; }
    .board-desc { display: none; }
    .menu-btn { display: inline-grid; margin-left: auto; }
    .topnav {
        display: none;
        position: absolute;
        top: 100%;
        right: 8px;
        z-index: 20;
        flex-direction: column;
        gap: 0;
        min-width: 12rem;
        padding: .35rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: var(--shadow);
    }
    .topnav a, .topnav .user-name { padding: .55rem .7rem; border-radius: 6px; }
    .topbar[data-menu-open] .topnav { display: flex; }
    .profile-fields { grid-template-columns: 1fr; gap: .1rem; }
    .profile-fields dd { margin-bottom: .5rem; }

    .panes { grid-template-rows: minmax(0, 1fr); padding: 0; }
    .splitter { display: none; }
    .pane { display: none; border: 0; border-radius: 0; }
    .panes[data-view="threads"] #pane-threads,
    .panes[data-view="thread"] #pane-thread,
    .panes[data-view="message"] #pane-message { display: block; }
    .back { display: inline-grid; }

    .threadlist > li.t {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "subject replies" "meta last";
        gap: 0 .75rem;
        padding: .45rem 16px;
        border-bottom: 1px solid var(--border);
    }
    .t-subject { grid-area: subject; white-space: normal; }
    .t-replies { grid-area: replies; }
    .t-author { grid-area: meta; font-size: .85rem; color: var(--muted); }
    .t-date { display: none; }
    .t-last { grid-area: last; text-align: right; }

    .tree > li { padding-block: .5rem; border-bottom: 1px solid var(--border); white-space: normal; }
    .msg { padding: .75rem 16px 1.25rem; }
}
