:root {
  /* Werte kommen aus der geteilten Tokens-Datei (kryptamc-tokens.css), damit das
     Forum dieselbe Palette wie KryptaMC/Markt/Bewerbung nutzt. */
  --bg: var(--km-bg);
  --card: var(--km-bg-elevated);
  --card-strong: var(--km-bg-elevated);
  --text: var(--km-text);
  --muted: var(--km-muted);
  --muted-2: var(--km-muted-2);
  --purple: var(--km-purple);
  --purple-2: var(--km-purple-deep);
  --cyan: var(--km-cyan);
  --line: var(--km-line);
  --line-strong: var(--km-line-strong);
  --shadow: var(--km-shadow-md);
  --radius: var(--km-radius-md);
  --max: var(--km-max-width);
  --danger: var(--km-danger);
  --ok: var(--km-ok);
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(157, 52, 255, 0.28), transparent 34rem),
    radial-gradient(circle at 88% 10%, rgba(22, 231, 223, 0.12), transparent 28rem),
    linear-gradient(180deg, #040109 0%, var(--bg) 46%, #030106 100%);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }

::selection { background: rgba(22, 231, 223, .28); color: #fff; }

.page-noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .08;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  width: min(var(--max), calc(100% - 32px));
  margin: 16px auto;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 4, 13, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 55px rgba(0,0,0,.38);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 950; letter-spacing: -.02em; font-size: 1.08rem; white-space: nowrap; }
.brand-mark { color: var(--purple); text-shadow: 0 0 16px rgba(157,52,255,.75); font-size: 1.15rem; }
.brand span span { color: var(--cyan); text-shadow: 0 0 16px rgba(22,231,223,.6); }

.server-status-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 18px; margin-left: 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-size: .82rem; font-weight: 800; white-space: nowrap; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.server-status-pill:hover { border-color: rgba(157,52,255,.45); color: #fff; background: rgba(255,255,255,.07); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #ffc247; box-shadow: 0 0 0 4px rgba(255,194,71,.14), 0 0 12px rgba(255,194,71,.7); transition: background .2s ease, box-shadow .2s ease; }
.server-status-pill.is-online .status-dot { background: #33ff83; box-shadow: 0 0 0 4px rgba(51,255,131,.14), 0 0 14px rgba(51,255,131,.85); }
.server-status-pill.is-offline .status-dot { background: #ff4d7d; box-shadow: 0 0 0 4px rgba(255,77,125,.14), 0 0 14px rgba(255,77,125,.8); }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a { color: var(--muted); font-weight: 800; font-size: .92rem; padding: 8px 12px; border-radius: 12px; transition: color .2s ease, background .2s ease; }
.main-nav a:hover, .main-nav a:focus-visible { color: #fff; background: rgba(255,255,255,.08); }

.header-search { flex: 1; max-width: 20rem; margin-left: 8px; }
.header-search input { width: 100%; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: .84rem; }

.auth-area { display: flex; align-items: center; gap: 8px; position: relative; }

/* ---------- Benachrichtigungen ---------- */

.notif-wrap { position: relative; }
.notif-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 900; }
.notif-badge[hidden] { display: none; }
.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; width: min(22rem, 90vw); max-height: 26rem; overflow-y: auto; border: 1px solid rgba(157,52,255,.4); border-radius: 16px; background: var(--card-strong); box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-panel-head strong { font-size: .88rem; }
.notif-panel-head button { background: none; border: 0; color: var(--cyan); font-size: .76rem; font-weight: 800; padding: 0; }
.notif-item { display: block; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .84rem; line-height: 1.5; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-item.is-unread { background: rgba(157,52,255,.08); }
.notif-item b { color: #fff; }
.notif-item time { display: block; margin-top: 3px; color: var(--muted-2); font-size: .72rem; }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--muted-2); font-size: .84rem; }

/* ---------- Suche ---------- */

.search-section { margin-bottom: 28px; }
.search-section h2 { font-size: 1.05rem; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.search-result { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); margin-bottom: 10px; }
.search-result:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.search-result-title { font-weight: 800; margin-bottom: 4px; }
.search-result-snippet { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.search-result mark { background: rgba(22,231,223,.28); color: #fff; border-radius: 3px; padding: 0 2px; }
.search-result-meta { color: var(--muted-2); font-size: .74rem; margin-top: 6px; }

/* ---------- Reaktionen & Bearbeiten ---------- */

.reaction-btn { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); color: var(--muted); font-size: .78rem; font-weight: 800; padding: 5px 12px; }
.reaction-btn:hover { border-color: rgba(157,52,255,.4); color: #fff; }
.reaction-btn.is-active { border-color: rgba(157,52,255,.55); background: rgba(157,52,255,.16); color: #e2c7ff; }

.edit-post-form textarea { min-height: 100px; }

.mention { color: var(--cyan); font-weight: 700; }

.pill-solved { background: rgba(51,255,131,.14); color: #a8ffcb; border: 1px solid rgba(51,255,131,.34); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); font-weight: 800; font-size: .85rem; transition: border-color .18s ease; }
.user-chip:hover { border-color: rgba(157,52,255,.5); }
.role-badge { font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.role-badge.admin { background: rgba(255, 93, 122, .16); color: #ffb3c2; border: 1px solid rgba(255,93,122,.4); }
.role-badge.moderator { background: rgba(22,231,223,.14); color: #a8fff8; border: 1px solid rgba(22,231,223,.4); }

.rank-badge { display: inline-flex; align-items: center; font-size: .64rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; vertical-align: middle; background: linear-gradient(135deg, rgba(157,52,255,.28), rgba(22,231,223,.22)); color: #f0e4ff; border: 1px solid rgba(157,52,255,.4); box-shadow: 0 0 12px rgba(157,52,255,.18); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--km-radius-sm);
  font-weight: 900; font-size: .9rem; color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--purple), var(--cyan)); box-shadow: 0 0 0 1px rgba(255,255,255,.13) inset, 0 14px 34px rgba(111,29,214,.45); }
.btn-secondary { background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.btn-ghost { border: 1px solid rgba(22,231,223,.34); background: rgba(22,231,223,.08); color: #dffffd; }
.btn-danger { border: 1px solid rgba(255,93,122,.4); background: rgba(255,93,122,.12); color: #ffcdd7; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .78rem; border-radius: 10px; }

/* ---------- Layout ---------- */

.app { position: relative; z-index: 1; width: min(var(--max), calc(100% - 32px)); margin: 0 auto; padding: 8px 0 80px; min-height: 50vh; }
.loading-hint { color: var(--muted); text-align: center; padding: 4rem 0; }

.page-heading { margin: 8px 0 26px; }
.eyebrow { margin: 0 0 10px; color: var(--cyan); text-transform: uppercase; font-size: .74rem; font-weight: 950; letter-spacing: .18em; text-shadow: 0 0 16px rgba(22,231,223,.32); }
.page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.08; }
.page-heading p { color: var(--muted); max-width: 42rem; line-height: 1.6; margin-top: 8px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--card), rgba(10,6,18,.9));
  box-shadow: var(--shadow);
}

/* ---------- Kategorien ---------- */

.category-list { display: flex; flex-direction: column; gap: 12px; }
.category-card {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--card), rgba(10,6,18,.88));
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.category-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 16px 40px rgba(0,0,0,.35), 0 0 0 1px rgba(157,52,255,.1); }
.category-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; font-size: 1.4rem; background: rgba(157,52,255,.12); border: 1px solid rgba(157,52,255,.3); color: var(--purple); }
.category-card.is-announcement .category-icon { background: rgba(22,231,223,.12); border-color: rgba(22,231,223,.32); color: var(--cyan); }
.category-info h2 { font-size: 1.1rem; margin-bottom: 4px; }
.category-info p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.category-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; color: var(--muted-2); font-size: .8rem; white-space: nowrap; }
.category-meta strong { color: var(--text); font-size: 1rem; }
.category-latest { color: var(--muted-2); font-size: .76rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Thread-Liste ---------- */

.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--cyan); }

.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255,255,255,.03); transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.thread-row:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); transform: translateY(-1px); }
.thread-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread-title-line a { font-weight: 800; font-size: .98rem; }
.thread-title-line a:hover { color: var(--cyan); }
.thread-sub { color: var(--muted-2); font-size: .78rem; margin-top: 3px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.pill-pinned { background: rgba(157,52,255,.16); color: #e2c7ff; border: 1px solid rgba(157,52,255,.4); }
.pill-locked { background: rgba(255,93,122,.14); color: #ffc2cf; border: 1px solid rgba(255,93,122,.35); }
.thread-stat { text-align: center; min-width: 64px; }
.thread-stat strong { display: block; font-size: 1rem; }
.thread-stat span { color: var(--muted-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.thread-activity { text-align: right; color: var(--muted-2); font-size: .8rem; min-width: 120px; }

.empty-state { padding: 3rem 1.5rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Thread-Ansicht ---------- */

.thread-header { margin-bottom: 20px; }
.thread-header h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.02em; line-height: 1.15; }
.thread-header-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.mod-toolbar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-card { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 18px; }
.post-avatar { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-weight: 950; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, var(--purple), var(--cyan)); }
.post-avatar[hidden] { display: none; }
img.post-avatar { object-fit: cover; image-rendering: pixelated; }
.post-avatar-wrap { display: contents; }
.post-body-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.post-author { font-weight: 900; }
.post-meta { color: var(--muted-2); font-size: .78rem; }
.post-content { color: #e7e1f5; line-height: 1.7; word-wrap: break-word; }
.post-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.post-actions[hidden] { display: none; }
/* "Loeschen" ist destruktiv und stand vorher direkt neben "Bearbeiten"/"Melden" mit
   winzigem Abstand -- das fuehrte zu Fehlklicks. Raeumlich absetzen statt nur per Farbe. */
.post-actions .btn-danger { margin-left: auto; }

/* ---------- Markdown-Inhalt ---------- */

.markdown-body p { margin: 0 0 .8em; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body strong { color: #fff; font-weight: 800; }
.markdown-body em { color: #e2d9f5; }
.markdown-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.markdown-body a:hover { color: #7bfff5; }
.markdown-body ul, .markdown-body ol { margin: 0 0 .8em; padding-left: 1.4em; }
.markdown-body li { margin-bottom: .3em; }
.markdown-body blockquote { margin: 0 0 .8em; padding: 8px 14px; border-left: 3px solid rgba(157,52,255,.5); background: rgba(157,52,255,.06); border-radius: 0 8px 8px 0; color: var(--muted); }
.markdown-body code { background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; color: #ffd7f3; }
.markdown-body pre { margin: 0 0 .8em; padding: 12px 14px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid var(--line); overflow-x: auto; }
.markdown-body pre code { background: none; border: 0; padding: 0; color: #d8f5ff; }
.markdown-body img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 4px 0 .8em; display: block; }

/* ---------- Markdown-Editor ---------- */

.md-editor { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(9,4,16,.7); }
.md-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); flex-wrap: wrap; }
/* Vorher: 30x30px mit nur 4px Abstand und unsichtbarer Umrandung (transparent bis zum Hover) --
   die Buttons liefen optisch ineinander, was zu Fehlklicks zwischen z.B. B/I oder Link/Bild
   fuehrte. Jetzt etwas groesser, mehr Abstand, und eine immer sichtbare Umrandung, damit klar
   ist, wo ein Button aufhoert und der naechste anfaengt. */
.md-btn { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--muted); font-weight: 800; font-size: .82rem; }
.md-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(157,52,255,.35); color: #fff; }
.md-toolbar-divider { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.md-btn.md-b { font-weight: 950; }
.md-btn.md-i { font-style: italic; }
.md-toolbar-spacer { flex: 1; }
.md-tab { padding: 5px 12px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted-2); font-weight: 800; font-size: .78rem; }
.md-tab.is-active { background: rgba(157,52,255,.16); color: #fff; border-color: rgba(157,52,255,.35); }
/* enhanceEditor() verschiebt die Textarea aus dem Flex-<label> in diesen Block-Container --
   ohne explizite Breite faellt sie dort auf die Browser-Standardbreite (~20 Zeichen) zurueck. */
.md-editor textarea { display: block; width: 100%; border: 0; border-radius: 0; min-height: 160px; }
.md-editor textarea:focus { box-shadow: none; }
.md-preview { padding: 14px 16px; min-height: 160px; }
.md-preview.is-empty { color: var(--muted-2); font-style: italic; }
.md-drop-hint { position: relative; }
.md-drop-hint.is-dragover::after { content: 'Bild hier ablegen'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(157,52,255,.14); color: #fff; font-weight: 800; pointer-events: none; }
.md-hint { padding: 6px 12px; font-size: .72rem; color: var(--muted-2); border-top: 1px solid var(--line); }

.mention-suggest { position: fixed; z-index: 90; min-width: 9rem; max-width: 16rem; border: 1px solid rgba(157,52,255,.4); border-radius: 12px; background: var(--card-strong); box-shadow: 0 16px 40px rgba(0,0,0,.5); overflow: hidden; }
.mention-suggest button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; color: var(--text); font-size: .86rem; font-weight: 700; }
.mention-suggest button.is-active, .mention-suggest button:hover { background: rgba(157,52,255,.18); color: #fff; }

.reply-box { margin-top: 24px; padding: 20px; }
.reply-box h2 { font-size: 1.05rem; margin-bottom: 12px; }
.locked-notice, .login-notice { padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); text-align: center; margin-top: 24px; }
.login-notice button { color: var(--cyan); font-weight: 800; text-decoration: underline; background: none; border: 0; padding: 0; }

/* ---------- Formulare ---------- */

form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 800; color: var(--muted); }
input, textarea {
  border: 1px solid var(--line); border-radius: 12px; background: rgba(9,4,16,.7); color: var(--text);
  padding: 13px 16px; font: inherit; font-weight: 500; min-height: 48px;
}
input:focus, textarea:focus { outline: none; border-color: rgba(157,52,255,.75); box-shadow: 0 0 0 3px rgba(157,52,255,.16); }
/* Browser-Autofill (Chrome/Edge/Safari) erzwingt sonst einen hellen Hintergrund - hier auf das dunkle Design zurueckgezwungen. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px rgba(9,4,16,.95) inset;
  box-shadow: 0 0 0 1000px rgba(9,4,16,.95) inset;
  caret-color: var(--text);
  transition: background-color 999999s ease-in-out 0s;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.form-hint { color: var(--muted-2); font-size: .78rem; margin: -6px 0 0; }
.form-error { color: var(--danger); font-size: .82rem; background: rgba(255,93,122,.1); border: 1px solid rgba(255,93,122,.3); border-radius: 10px; padding: 8px 12px; margin: 0; }
.form-success { color: #a8ffcb; font-size: .82rem; background: rgba(51,255,131,.1); border: 1px solid rgba(51,255,131,.3); border-radius: 10px; padding: 8px 12px; margin: 0; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 4px; }
.modal-link-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 2px;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.03); color: var(--muted); font-size: .84rem; font-weight: 800;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.modal-link-btn:hover { border-color: rgba(22,231,223,.4); background: rgba(22,231,223,.06); color: var(--cyan); }

.new-thread-form { padding: 22px; }

/* ---------- Modals ---------- */

.modal-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(3,1,8,.72); backdrop-filter: blur(6px); padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal { position: relative; width: min(460px, 100%); padding: 36px 32px 32px; border: 1px solid rgba(157,52,255,.4); border-radius: 24px; background: var(--card-strong); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.modal h2 { font-size: 1.4rem; margin-bottom: 18px; letter-spacing: -.02em; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--muted); }
.modal-close:hover { color: #fff; }
.modal-switch { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.modal-switch button { background: none; border: 0; color: var(--cyan); font-weight: 800; padding: 0; }

.oauth-row { margin-top: 14px; }
.oauth-row .btn { width: 100%; }
.oauth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.account-section { padding: 22px; margin-top: 4px; }
.account-section h2 { font-size: 1.05rem; margin-bottom: 12px; }
.mc-code-box { margin-top: 12px; padding: 14px 16px; border: 1px solid rgba(157,52,255,.4); border-radius: 12px; background: rgba(157,52,255,.08); }
.mc-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.3rem; letter-spacing: .12em; color: var(--cyan); }

/* ---------- Toast ---------- */

.toast-message {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%);
  z-index: 80; display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; border: 1px solid rgba(22,231,223,.35);
  background: #14101f; color: #dffffd; font-weight: 800; font-size: .88rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); transition: transform .3s ease;
}
.toast-message.is-error { border-color: rgba(255,93,122,.4); color: #ffd7de; }
.toast-message.is-visible { transform: translate(-50%, 0); }

/* ---------- Admin-Dashboard ---------- */

.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.admin-tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-weight: 800; font-size: .84rem; }
.admin-tab:hover { color: #fff; }
.admin-tab.is-active { border-color: rgba(157,52,255,.5); background: rgba(157,52,255,.14); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-tile { padding: 18px 20px; }
.stat-tile span { display: block; color: var(--muted-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; margin-bottom: 6px; }
.stat-tile strong { font-size: 1.7rem; letter-spacing: -.02em; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 10px 12px; color: var(--muted-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: .88rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table-wrap { overflow-x: auto; }
.admin-table select { padding: 6px 8px; min-height: auto; font-size: .82rem; }

.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.status-pill.active { background: rgba(51,255,131,.12); color: #a8ffcb; border: 1px solid rgba(51,255,131,.32); }
.status-pill.banned { background: rgba(255,93,122,.14); color: #ffc2cf; border: 1px solid rgba(255,93,122,.35); }

.report-card { padding: 16px 18px; margin-bottom: 12px; }
.report-card-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted-2); font-size: .78rem; margin-bottom: 8px; }
.report-card-content { color: #e7e1f5; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; line-height: 1.6; white-space: pre-wrap; }
.report-reason { color: var(--muted); font-size: .84rem; margin-bottom: 10px; }
.report-actions { display: flex; gap: 8px; }

.category-admin-card { padding: 18px; margin-bottom: 14px; }
.category-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.category-admin-grid label { grid-column: span 1; }
.category-admin-grid .full { grid-column: 1 / -1; }
.checkbox-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.checkbox-row input { width: auto; }
.category-admin-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }

.modlog-list { display: flex; flex-direction: column; gap: 8px; }
.modlog-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); font-size: .84rem; flex-wrap: wrap; }
.modlog-action { font-weight: 800; color: var(--cyan); }
.modlog-detail { color: var(--muted); }
.modlog-time { color: var(--muted-2); white-space: nowrap; }

/* Vorher: padding:0 und reiner Unterstrich-Text -- die Klickflaeche war winzig und sass
   dicht neben anderen Buttons, was zu Fehlklicks fuehrte. Jetzt ein richtiger Button mit
   ausreichender Trefferflaeche, optisch weiterhin dezent ("ghost") statt aufdringlich. */
.report-btn-inline {
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03);
  color: var(--muted); font-size: .78rem; font-weight: 800; padding: 5px 12px; min-height: 34px;
  display: inline-flex; align-items: center; text-decoration: none;
}
.report-btn-inline:hover, .report-btn-inline:focus-visible { border-color: rgba(157,52,255,.4); color: #fff; }
.banned-tag { color: var(--danger); font-size: .7rem; font-weight: 800; text-transform: uppercase; margin-left: 6px; }

@media (max-width: 720px) {
  .category-admin-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

.site-footer { position: relative; z-index: 1; padding: 30px 16px 50px; text-align: center; color: var(--muted-2); font-size: .82rem; }
.site-footer a { color: var(--muted-2); }
.site-footer a:hover { color: var(--cyan); }

@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; }
  .header-search { max-width: none; margin-left: 0; }
  .server-status-pill { margin-left: auto; padding: 8px 10px; }
  .server-status-pill [data-status-text] { display: none; }
  .notif-panel { position: fixed; top: 76px; right: 8px; left: 8px; width: auto; }
  .category-card { grid-template-columns: 44px 1fr; }
  .category-meta { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; gap: 10px; }
  .thread-row { grid-template-columns: 1fr; text-align: left; }
  .thread-stat, .thread-activity { text-align: left; }
  .post-card { grid-template-columns: 40px 1fr; }
  .post-avatar { width: 40px; height: 40px; font-size: .95rem; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .category-card, .thread-row, .toast-message { transition: none; }
}
