/* =====================================================================
   SaboDan Forum – Grund-CSS
   Alle Farben, Abstände und Radien laufen über CSS-Variablen.
   Ein Style (themes/<name>/style.css) überschreibt nur diese Variablen
   und ergänzt bei Bedarf eigene Regeln.
   ===================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/static/fonts/SchibstedGrotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* SaboDan-Farben */
  --brand: #336699; --brand-hover: #2a5580; --brand-tint: #e7eef6; --brand-ink: #24496e;
  --on-brand: #ffffff;
  --bg: #f2f3f5;
  --panel: #ffffff; --panel-2: #f7f8fa; --ink: #1d2733; --muted: #5f6b7a;
  --line: #e1e4e8; --line-strong: #cdd2d8;
  --danger: #b42318; --danger-tint: #fdecea; --ok: #157347; --ok-tint: #e7f4ec;
  --warn: #8a5a00; --warn-tint: #fff4d6;
  --radius: 12px; --radius-s: 8px;

  /* Schrift & Maße */
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --fs: 15px; --lh: 1.55;
  --side-w: 252px;
  --content-w: 1040px;
  --pad-x: 44px; --pad-y: 34px;
  --card-pad: 24px;
  --row-py: 14px;
  --avatar: 38px;
  --gap: 18px;
  --shadow-auth: 0 10px 40px rgba(29, 39, 51, .08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #7fa7d1; --brand-hover: #9dbde0; --brand-tint: #1f2f40; --brand-ink: #b9d0e8;
    --on-brand: #0f1720;
    --bg: #14181d; --panel: #1b2027; --panel-2: #20262e; --ink: #e6e9ee; --muted: #9aa4b2;
    --line: #2a313a; --line-strong: #3a434e;
    --danger: #f08a80; --danger-tint: #3a1f1d; --ok: #6fcf97; --ok-tint: #17301f;
    --warn: #f2c66d; --warn-tint: #3a2f14;
    --shadow-auth: 0 10px 40px rgba(0, 0, 0, .35);
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs)/var(--lh) var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: var(--radius-s); z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ic { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Gerüst: Seitenleiste + Inhalt ---------- */
.shell {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh;
  /* Seitenleisten-Fläche läuft auf langen Seiten bis ganz nach unten */
  background: linear-gradient(90deg, var(--panel) calc(var(--side-w) - 1px), var(--line) calc(var(--side-w) - 1px), var(--line) var(--side-w), transparent var(--side-w));
}
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; padding: 20px 14px 16px;
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; min-width: 0; }
.brand:hover { color: var(--ink); text-decoration: none; }
.logo-img { height: 34px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-mobile-actions { display: none; }

.nav { display: flex; flex-direction: column; gap: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12.5px; color: var(--muted); padding: 0 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--ink); font-weight: 500;
}
.nav-item:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--brand-tint); color: var(--brand-ink); font-weight: 650; }
.nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .ic { color: var(--muted); }
.nav-item.is-active .ic { color: var(--brand-ink); }
.nav-only-m { display: none; }
.count { font-style: normal; font-size: 12px; font-weight: 650; background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--brand)); flex: none; margin: 0 4px; }
.dot-l { width: 14px; height: 14px; border-radius: 4px; margin: 0 10px 2px 0; vertical-align: middle; }

.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.userblock { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-s); color: var(--ink); }
.userblock:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.userblock.is-active { background: var(--brand-tint); }
.userblock span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.userblock strong { overflow: hidden; text-overflow: ellipsis; }
.userblock small { color: var(--muted); font-size: 12.5px; }
.side-links { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.side-links a, .linkbtn {
  display: flex; align-items: center; gap: 9px; color: var(--muted); font: inherit; font-size: 14px;
  background: none; border: 0; padding: 5px 6px; cursor: pointer; border-radius: 6px; text-align: left; width: 100%;
}
.side-links a:hover, .linkbtn:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.side-links .ic { width: 17px; height: 17px; }
.guest { display: flex; flex-direction: column; gap: 8px; }
.legal, .version { font-size: 12.5px; color: var(--muted); padding: 0 6px; }
.legal a { color: var(--muted); }
.side-new { margin: 0 2px; }

.styleswitch { display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.ss-label { display: flex; align-items: center; gap: 6px; flex: 1; position: relative; }
.ss-ico { color: var(--muted); display: flex; }
.styleswitch select { flex: 1; padding: 6px 8px; font-size: 13.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: var(--content-w); margin: 0 auto; padding: var(--pad-y) var(--pad-x) 60px; flex: 1; }
.content-wide { max-width: 1180px; }
.foot-m { display: none; }

/* ---------- Kopfbereiche ---------- */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pagehead .lead { color: var(--muted); margin: 0; max-width: 70ch; }
.pagehead-btn { flex: none; }
.crumb { margin: 0 0 6px; font-size: 14px; }
.crumb a { color: var(--muted); }
.sect { margin: 30px 0 12px; display: flex; align-items: center; gap: 8px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-info { margin: 0; font-size: 13.5px; }
.segmented { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a { padding: 6px 14px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 14px; }
.segmented a:hover { color: var(--ink); text-decoration: none; background: var(--panel-2); }
.segmented a.is-active { background: var(--brand-tint); color: var(--brand-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand);
  font: 600 14.5px/1.2 var(--font); padding: 10px 16px; border-radius: var(--radius-s); cursor: pointer;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); text-decoration: none; }
.btn .ic { width: 17px; height: 17px; }
.btn-sec { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn-sec:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line-strong); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }
.btn-s { padding: 6px 11px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-s); color: var(--ink); }
.iconbtn:hover { background: var(--panel-2); }

/* ---------- Karten, Pillen, Meldungen ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--card-pad); margin-bottom: var(--gap); }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.pill-brand { background: var(--brand-tint); color: var(--brand-ink); border-color: transparent; }
.pill-ok { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.pill-danger { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.pill-warn { background: var(--warn-tint); color: var(--warn); border-color: transparent; }
.notice { border: 1px solid; border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 18px; font-weight: 500; }
.notice-ok { background: var(--ok-tint); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.notice-error { background: var(--danger-tint); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.empty { text-align: center; padding: 48px 24px; }
.empty .ic { width: 34px; height: 34px; color: var(--muted); margin-bottom: 8px; }

.avatar {
  --size: var(--avatar);
  width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  background: var(--av, var(--brand)); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: calc(var(--size) * .38); letter-spacing: .02em; user-select: none;
}
.avatar-s { --size: 28px; }
.avatar-xl { --size: 76px; }

.catpill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink); }
.catpill i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.catpill:hover { color: var(--ink); }
.flag { color: var(--muted); display: inline-flex; vertical-align: -3px; margin-right: 2px; }
.flag .ic { width: 17px; height: 17px; }

/* ---------- Themenliste ---------- */
.topiclist { padding: 0; overflow: hidden; }
.tl-head, .tl-row { display: grid; grid-template-columns: minmax(0, 1fr) 86px 80px 110px; align-items: center; gap: 12px; }
.tl-head { padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tl-row { grid-template-columns: var(--avatar) minmax(0, 1fr) 86px 80px 110px; padding: var(--row-py) 20px; border-bottom: 1px solid var(--line); gap: 14px; }
.tl-head { grid-template-columns: minmax(0, 1fr) 86px 80px 110px; padding-left: calc(20px + var(--avatar) + 14px); }
.tl-row:last-child { border-bottom: 0; }
.tl-row:hover { background: var(--panel-2); }
.tl-row.is-pinned { background: color-mix(in srgb, var(--brand-tint) 45%, var(--panel)); }
.tl-title { font-size: 16px; font-weight: 600; margin: 0 0 3px; line-height: 1.35; }
.tl-title a { color: var(--ink); }
.tl-title a:hover { color: var(--brand); }
.tl-title a:visited { color: color-mix(in srgb, var(--ink) 72%, var(--muted)); }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.tl-meta a:not(.catpill) { color: var(--muted); }
.tl-mobile { display: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tl-col strong { font-weight: 650; }
.tl-act { display: flex; flex-direction: column; align-items: flex-end; font-size: 13.5px; line-height: 1.3; }
.tl-act small { color: var(--muted); font-size: 12px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.pager-nums { display: inline-flex; gap: 4px; }
.pager-nums a, .pager-cur, .pager-gap { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-s); font-variant-numeric: tabular-nums; }
.pager-nums a { color: var(--ink); }
.pager-nums a:hover { background: var(--panel); text-decoration: none; }
.pager-cur { background: var(--brand); color: var(--on-brand); font-weight: 650; }

/* ---------- Kategorien ---------- */
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.catcard { display: flex; flex-direction: column; color: var(--ink); border-left: 4px solid var(--c); margin: 0; }
.catcard:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); border-left-color: var(--c); }
.catcard h2 { margin-bottom: 4px; }
.catcard p { flex: 1; font-size: 14px; }
.catcard-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; }
.pagehead-cat h1 { display: flex; align-items: center; }
.pagehead-cat .dot-l { background: var(--c); }

/* ---------- Thema & Beiträge ---------- */
.topichead { margin-bottom: 18px; }
.topichead h1 { font-size: 28px; }
.topicmeta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; margin: 0; }
.topicmeta span { display: inline-flex; align-items: center; gap: 6px; }
.topicmeta .ic { width: 16px; height: 16px; }
.modtools { margin-top: 12px; }
.modtools summary { list-style: none; display: inline-flex; }
.modtools summary::-webkit-details-marker { display: none; }
.modtools-panel { margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.modrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.modrow select { width: auto; min-width: 180px; }

.posts { display: flex; flex-direction: column; }
.post { display: grid; grid-template-columns: var(--avatar) minmax(0, 1fr); gap: 16px; scroll-margin-top: 20px; }
.post:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.post.is-deleted { opacity: .7; border-style: dashed; }
.post-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; font-size: 14px; }
.post-author { font-weight: 650; color: var(--ink); font-size: 15px; }
.post-time { color: var(--muted); }
.post-no { margin-left: auto; font-size: 13px; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px; margin-top: 12px; }
.post-actions form { display: contents; }
.act {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 9px; border-radius: var(--radius-s);
  color: var(--muted); font: 500 13.5px var(--font); cursor: pointer;
}
.act:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.act .ic { width: 17px; height: 17px; }
.act-static { cursor: default; }
.act-static:hover { background: none; color: var(--muted); }
.act-danger:hover { color: var(--danger); background: var(--danger-tint); }
.like.is-liked { color: #d1435b; }
.like.is-liked .ic { fill: currentColor; }
.like-count:empty { display: none; }

.replybox { margin-top: 8px; }
.reply-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.reply-guest { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reply-guest p { margin: 0; }
.replyform .btnrow { justify-content: flex-end; margin-top: 10px; }

/* Text in Beiträgen */
.prose { overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin: 0 0 .85em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote { border-left: 3px solid var(--line-strong); background: var(--panel-2); margin-left: 0; padding: 8px 14px; color: var(--muted); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: var(--panel-2); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--radius-s); overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { border-radius: var(--radius-s); height: auto; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.1em; }
.prose h1 { font-size: 22px; }
.prose hr { margin: 1.2em 0; }

/* ---------- Formulare ---------- */
.form h2 { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.span-2, .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 14.5px; font-weight: 550; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel); width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 9px 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input:disabled { background: var(--panel-2); color: var(--muted); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input[type=color] { padding: 3px; height: 40px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=file] { padding: 7px; background: var(--panel-2); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px);
  padding: 12px 0; margin-top: -4px; border-top: 1px solid var(--line);
}
.card.form .savebar { margin: 20px calc(var(--card-pad) * -1) calc(var(--card-pad) * -1); padding: 14px var(--card-pad); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.form .btnrow { margin-top: 16px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }
.hp { position: absolute; left: -5000px; height: 0; overflow: hidden; }

/* Schalter-Zeilen */
.switchrow { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 0; cursor: pointer; border-top: 1px solid var(--line); margin-top: 14px; }
.form-stack .switchrow { border: 0; margin: 0; padding: 0; }
.switchrow input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 40px; height: 23px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; margin-top: 1px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switchrow input:checked + .switch { background: var(--brand); }
.switchrow input:checked + .switch::after { transform: translateX(17px); }
.switchrow input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--brand-tint); }
.switchrow > span:last-child { display: flex; flex-direction: column; }
.switchrow small { font-size: 13px; }

/* Auswahlkarten */
.choicegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.choice {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 12px 14px;
}
.choice:hover { border-color: var(--brand); }
.choice.is-selected, .choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice small { font-size: 12.5px; line-height: 1.4; }
.swatch { display: flex; gap: 4px; margin-bottom: 4px; }
.swatch i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); }
.swatch-l i { width: 34px; height: 34px; border-radius: 8px; }

/* Editor */
.editor { border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--panel); overflow: hidden; }
.editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.editor textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 140px; }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap; }
.eb { background: none; border: 0; color: var(--muted); font: 600 14px var(--font); min-width: 32px; height: 30px; padding: 0 8px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.eb:hover { background: var(--panel); color: var(--ink); }
.eb .ic { width: 17px; height: 17px; }
.eb-space { flex: 1; }
.eb-tab.is-active { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.editor-preview { padding: 12px 14px; min-height: 140px; }
.editor .hint { padding: 6px 12px 8px; border-top: 1px solid var(--line); background: var(--panel-2); }

/* Suche */
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px 6px 6px 14px; margin-bottom: 20px; }
.searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.searchbar .ic { color: var(--muted); }
.searchbar input { border: 0; padding: 8px 4px; box-shadow: none !important; background: transparent; }
.hits { padding: 0; overflow: hidden; }
.hit { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--ink); }
.hit:last-child { border-bottom: 0; }
.hit:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.hit > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hit .muted { font-size: 13px; }
.hit-text { font-size: 14px; color: var(--muted); }

/* Profil */
.profile { display: flex; gap: 20px; align-items: center; }
.profile h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile p:last-child { margin: 0; }

/* ---------- Verwaltung ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; display: flex; flex-direction: column; }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi strong { font-size: 30px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 13px; font-weight: 550; color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--panel-2); }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.table .catpill { white-space: nowrap; }
.card > .table th:first-child, .card > .table td:first-child { padding-left: 0; }
.card > .table th:last-child, .card > .table td:last-child { padding-right: 0; }
.table-card .table th:first-child, .table-card .table td:first-child { padding-left: 20px; }
.table-card .table th:last-child, .table-card .table td:last-child { padding-right: 20px; }
.usercell { display: flex; align-items: center; gap: 8px; }
.table td > small { display: block; margin-top: 2px; font-size: 12px; }
.plainlist { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 14px; }
.steps li > span { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; font-weight: 650; flex: none; font-size: 14px; }
.steps p { margin: 2px 0 0; font-size: 14px; }
.steps code { word-break: break-all; }
.logo-preview { display: flex; align-items: center; gap: 10px; height: 58px; padding: 10px 12px; background: var(--panel-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-s); }
.logo-preview img { height: 34px; width: auto; max-width: 100%; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.danger-zone .inline-form input { min-width: 260px; }
.catedit { display: flex; flex-direction: column; }
.catrow { border-left: 4px solid var(--c); }
.catrow-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 90px 90px; gap: 14px 16px; }
.catrow-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; font-size: 13.5px; }
.stylegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stylecard { margin: 0; }
.stylecard h2 { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

/* ---------- Anmeldeseite ---------- */
.auth-page { min-height: 100vh; position: relative; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.auth-bg path { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; }
.auth-bg circle { fill: var(--panel); stroke: var(--brand); stroke-width: 2; opacity: .55; }
.auth-wrap { position: relative; z-index: 1; max-width: 420px; margin: 0 auto; padding: 56px 18px 40px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink); font-size: 20px; font-weight: 700; margin-bottom: 22px; }
.auth-brand:hover { color: var(--ink); text-decoration: none; }
.auth-brand .logo-img { height: 40px; }
.logo-draw { width: 44px; height: 44px; fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.logo-draw path { stroke-dasharray: 140; stroke-dashoffset: 140; animation: draw 1.4s ease-out forwards; }
.logo-draw path + path { animation-delay: .35s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .logo-draw path { animation: none; stroke-dashoffset: 0; } }
.auth-card { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-auth); padding: 30px 28px; border: 1px solid var(--line); }
.auth-card h1 { font-size: 22px; }
.auth-alt { margin: 18px 0 0; font-size: 14px; text-align: center; }
.auth-foot { text-align: center; margin-top: 18px; }

/* ---------- Einbettung ---------- */
.embed { background: transparent; }
.embed-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.embed-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.embed-row { display: flex; flex-direction: column; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.embed-row:last-child { border-bottom: 0; }
.embed-row:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.embed-title { font-weight: 600; }
.embed-row .muted { font-size: 12.5px; }
.embed-row .dot { width: 8px; height: 8px; margin: 0 5px 0 0; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .tl-head, .tl-row { grid-template-columns: var(--avatar) minmax(0, 1fr) 76px 100px; }
  .tl-head { grid-template-columns: minmax(0, 1fr) 76px 100px; }
  .tl-head span:nth-child(3), .tl-views { display: none; }
  .cols { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --pad-x: 16px; --pad-y: 18px; --card-pad: 18px; --avatar: 34px; }
  .shell { grid-template-columns: 1fr; background: none; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; overflow: visible;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 0 0; gap: 8px;
  }
  .side-top { padding: 0 12px; }
  .logo-img { height: 30px; max-width: 140px; }
  .brand-name { font-size: 15px; }
  .side-mobile-actions { display: flex; align-items: center; gap: 4px; flex: none; }
  .side-new, .side-bottom, .nav-label, .nav-cats, .nav-hide-m { display: none; }
  .nav-only-m { display: flex; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 0 8px; gap: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-group { flex-direction: row; gap: 2px; }
  .nav-item { white-space: nowrap; padding: 9px 12px 11px; border-radius: 0; border-bottom: 2px solid transparent; }
  .nav-item.is-active { background: none; border-bottom-color: var(--brand); }
  .nav-item span { overflow: visible; }
  .foot-m { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 16px 30px; border-top: 1px solid var(--line); }
  .foot-m .styleswitch { width: 100%; max-width: 280px; }

  h1 { font-size: 22px; }
  .topichead h1 { font-size: 22px; }
  .pagehead { flex-direction: column; gap: 10px; }
  .pagehead-btn { align-self: stretch; }
  .pagehead > .btn.pagehead-btn { display: none; } /* „Neues Thema“ liegt mobil in der Navigation */
  .admin .pagehead > .btn.pagehead-btn, .is-admin .pagehead > .btn.pagehead-btn { display: inline-flex; }

  .tl-head { display: none; }
  .tl-row { grid-template-columns: var(--avatar) minmax(0, 1fr); padding: 13px 14px; gap: 12px; align-items: start; }
  .tl-col { display: none; }
  .tl-mobile { display: inline; }
  .tl-meta { gap: 2px 8px; }
  .tl-title { font-size: 15.5px; }

  .post { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-side { display: none; }
  .post-head { margin-bottom: 6px; }
  .act-label { display: none; }
  .act { padding: 8px 10px; }

  .form-grid, .catrow-grid { grid-template-columns: 1fr; }
  .catrow-grid .field-color, .catrow-grid .field-pos { display: inline-flex; }
  .profile { flex-direction: column; align-items: flex-start; }
  .table { font-size: 14px; }
  .danger-zone .inline-form input { min-width: 0; flex: 1; }
  .reply-guest { flex-direction: column; align-items: stretch; }
  .reply-guest .btn { flex: 1; }
}

@media print {
  .side, .foot-m, .post-actions, .replybox, .pager, .modtools { display: none !important; }
  .shell { display: block; }
  .card { border: 0; padding: 0; }
}

/* ---------- SSO ---------- */
.btn-sso { padding: 12px 16px; font-size: 15px; }
.sso-hint { text-align: center; margin: 8px 0 4px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
