/*
 * Additives Overlay-Stylesheet fuer das Forum-Theme "bvb".
 * Zieht Farben/Typografie an das brand-v16-Design von Hauptseite/Dev/Staging an,
 * ohne style.css oder das Smarty-Markup zu aendern.
 *
 * Aktivierung: Klasse "brand-v16-forum" am <body> (main.tpl).
 * Deaktivieren/Rollback: Klasse entfernen oder diesen <link> aus main.tpl loeschen.
 *
 * Umfang Stufe 1: Header, Navigationsleisten, Grundfarben, Typografie.
 * Thread-/Post-Listen, Formulare und Editor folgen in einer spaeteren Stufe.
 */

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/brand-v16/atkinson-hyperlegible-400.woff2) format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/brand-v16/atkinson-hyperlegible-700.woff2) format("woff2");
}

@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/brand-v16/barlow-semi-condensed-400.woff2) format("woff2");
}

@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/brand-v16/barlow-semi-condensed-700.woff2) format("woff2");
}

body.brand-v16-forum {
  /* Default = Light Mode. Dark Mode ist kein neuer Standard, sondern greift
     ausschliesslich ueber die Systemeinstellung (prefers-color-scheme) weiter
     unten - genau wie im brand-v16-System der Hauptseite. */
  --sgv16f-bg: #F5F5F5;
  --sgv16f-surface: #FFFFFF;
  --sgv16f-surface-2: #EBEBEB;
  --sgv16f-text: #121212;
  --sgv16f-text-2: #1A1A1A;
  /* #616873: >= 4.7:1 auch auf --sgv16f-surface-2 (#EBEBEB); #6B7280 lag dort nur bei 4.06:1 */
  --sgv16f-text-3: #616873;
  --sgv16f-line: #FFCC00;
  --sgv16f-yellow: #FFCC00;
  --sgv16f-yellow-hover: #E6B800;
  --sgv16f-red: #CC0000;
  --sgv16f-red-hover: #A30000;

  /* #FFCC00 als Textfarbe auf hellem Grund (#FFFFFF/#F5F5F5) hat nur ~1.5:1
     Kontrast - weit unter WCAG AA (4.5:1). --sgv16f-yellow bleibt fuer
     Hintergruende/Rahmen/Chips unveraendert gelb (dort ist die dunkle
     --sgv16f-yellow-ink-Schrift das Kontrastproblem, nicht das Gelb selbst).
     Fuer Gelb ALS Schriftfarbe gibt es dieses eigene Token: im Light Mode ein
     abgedunkeltes Gold (gleicher Farbton/Saettigung wie #FFCC00, nur dunkler -
     ca. 6:1 zu Weiss, >= 5:1 auch auf --sgv16f-surface-2 #EBEBEB), im Dark
     Mode das normale helle Gelb. */
  --sgv16f-yellow-text: #7A6000;
  --sgv16f-yellow-text-hover: #665200;

  /* Theme-unabhaengige Konstanten (bewusst nicht in der @media-Ueberschreibung unten) */
  --sgv16f-yellow-ink: #121212;    /* Text/Logo auf Gelb: immer dunkel, unabhaengig vom Modus */

  /* Gemeinsame Breite fuer Header/Content/Footer (Stufe 3) - vorher hatten diese
     Bereiche uneinheitliche max-width-Werte in style.css (1280px/1240px gemischt). */
  --sgv16f-container-max: 1000px;
}

@media (prefers-color-scheme: dark) {
  body.brand-v16-forum {
    --sgv16f-bg: #121212;
    --sgv16f-surface: #1A1A1A;
    --sgv16f-surface-2: #2E2E2E;
    --sgv16f-text: #F5F5F5;
    --sgv16f-text-2: #D0D0D0;
    /* #ABABAB: >= 5.9:1 auf --sgv16f-surface-2 (#2E2E2E) */
    --sgv16f-text-3: #ABABAB;
    --sgv16f-red: #FF6B6B;
    --sgv16f-red-hover: #FF8A8A;
    --sgv16f-yellow-text: #FFCC00;
    --sgv16f-yellow-text-hover: #E6B800;
  }
}

/* Grundfarben & Typografie */
body.brand-v16-forum {
  background-color: var(--sgv16f-bg) !important;
  background-image: none !important;
  color: var(--sgv16f-text-2);
  font-family: "Atkinson Hyperlegible", sans-serif;
}

/* style.css setzt viele Schriftgroessen sehr klein (0.69em/0.7em ~ 11px bei 100.1%
   Basisgroesse). Die Basisgroesse skaliert alle em-Werte proportional mit und hebt
   so die kleinste vorkommende Groesse an, ohne die bestehende Groessen-Hierarchie
   (Ueberschrift > Text > Meta-Text) durcheinanderzubringen. Nur Desktop, mobil
   bleibt unangetastet (dort greifen eigene Breakpoints in style.css). */
@media (min-width: 769px) {
  body.brand-v16-forum {
    font-size: 112%;
  }
}

body.brand-v16-forum h1,
body.brand-v16-forum h2,
body.brand-v16-forum h3,
body.brand-v16-forum h4 {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  color: var(--sgv16f-text);
}

/* Im Bright-Mode (Standard) simples Schwarz statt Gelb - bewusst als fester
   Wert statt --sgv16f-text (der waere im Dark Mode fast weiss). Im Dark Mode
   bleibt die gelbe Akzentfarbe erhalten, siehe Ueberschreibung in der
   @media(prefers-color-scheme:dark)-Regel weiter unten. */
body.brand-v16-forum a {
  color: #121212;
}

body.brand-v16-forum a:visited {
  color: #121212;
}

/* Gegenstueck zum festen #121212 oben - im Dark Mode bleibt Gelb die
   Link-Akzentfarbe. Muss NACH der Bright-Mode-Basisregel stehen: bei
   gleicher Spezifitaet (body.brand-v16-forum a) gewinnt sonst die spaeter
   im Stylesheet stehende Regel unabhaengig vom @media-Zustand. */
@media (prefers-color-scheme: dark) {
  body.brand-v16-forum a,
  body.brand-v16-forum a:visited {
    color: var(--sgv16f-yellow-text);
  }
}

body.brand-v16-forum a:hover {
  color: var(--sgv16f-yellow-text-hover);
}

body.brand-v16-forum a.menuelink,
body.brand-v16-forum a.menuelink:visited,
body.brand-v16-forum a.menuelink:active,
body.brand-v16-forum #topnav a,
body.brand-v16-forum #topnav a:visited,
body.brand-v16-forum #topnav a:active {
  color: var(--sgv16f-text) !important;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
}

/* Kopfbereich. Gelb wie der Header der Hauptseite - moeglich, weil das Logo ein
   einfarbiges, inline eingebettetes SVG ist (statt eines zweifarbigen Bild-Logos),
   dessen Fuellfarbe wir selbst steuern. */
body.brand-v16-forum .sgv16f-header {
  background: var(--sgv16f-yellow);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

/* Farblich mit dem gelben Header vereinheitlicht: kein dunkler Kasten mehr,
   stattdessen ein sauberes weisses Feld mit Rahmen/Fokus-Ring in derselben
   dunklen Ink-Farbe wie Logo und Zoom-Buttons daneben. */
body.brand-v16-forum .searchbox {
  background-color: transparent;
}

/* #search_top (ID) statt nur .searchbox input, damit das spaeter im Stylesheet
   folgende generische "input[type=text]"-Regel (Formulare-Abschnitt, gleiche
   Klassen-Spezifitaet, aber spaeter -> gewinnt sonst) nicht die weisse Box
   wieder auf die dunkle Theme-Oberflaeche zurueckdreht. */
body.brand-v16-forum .searchbox #search_top {
  background: #FFFFFF;
  color: var(--sgv16f-yellow-ink);
  border: 1px solid var(--sgv16f-yellow-ink);
  border-radius: 0;
}

body.brand-v16-forum .searchbox #search_top:focus {
  color: var(--sgv16f-yellow-ink) !important;
  outline: 2px solid var(--sgv16f-yellow-ink);
  outline-offset: 1px;
}

/* Schriftzug-Logo: inline-SVG, Fuellfarbe auf die Header-Ink-Farbe gesetzt. */
body.brand-v16-forum .sgv16f-logobox {
  flex: 0 0 auto;
}

/* Groesse 1:1 wie die Hauptseite (.site-header .logo in deren brand-v16.css):
   feste 40px Hoehe, aber auf schmalen Viewports ueber max-width proportional
   verkleinert - vorher blieb der Schriftzug auf Mobile bei voller Groesse. */
body.brand-v16-forum .sgv16f-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 40px;
  max-width: min(calc(100vw - 170px), 360px);
}

body.brand-v16-forum .sgv16f-wordmark svg {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
}

body.brand-v16-forum .sgv16f-wordmark svg path {
  fill: var(--sgv16f-yellow-ink);
}

body.brand-v16-forum .sgv16f-claim {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-weight: bolder;
  font-size: 1rem;
  color: var(--sgv16f-yellow-ink);
  margin-top: .15rem;
  text-align: center;
}

/* Nutzer-/Kontoleiste (ehem. #headtop) */
body.brand-v16-forum .sgv16f-utility-nav {
  background-color: var(--sgv16f-surface-2);
  border-left: 0;
  border-right: 0;
  font-family: "Atkinson Hyperlegible", sans-serif;
}

/* Login/Registrieren (und die linke Leiste) waren im Original mit 0.8em auf
   Basis von 12px verschwindend klein (~9.6px). Deutlich groesser gesetzt. */
body.brand-v16-forum .sgv16f-utility-left,
body.brand-v16-forum .sgv16f-utility-right {
  font-size: 1.05rem;
}

/* Sub-Navigation (Kategorien) - gemeinsame Regel fuer Kopf- UND Fussbereich,
   beide tragen die Klasse .sgv16f-catnav (ehem. getrennt #topnav/#bottomnav
   mit fast identischem CSS). */
body.brand-v16-forum .sgv16f-catnav {
  background: var(--sgv16f-surface);
  border-left: 0;
  border-right: 0;
  border-top: 1px solid var(--sgv16f-line);
  border-bottom: 1px solid var(--sgv16f-line);
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum .sgv16f-catnav--footer a {
  color: var(--sgv16f-text) !important;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
}

body.brand-v16-forum #headerbox {
  background: var(--sgv16f-surface);
  border-left: 0;
  border-right: 0;
  color: var(--sgv16f-text);
  /* Original hatte margin-bottom:0 - #content (Thread-Liste + "letzte
     Eintraege"-Sidebar) begann direkt danach mit nur 20px eigenem Padding.
     Mehr Luft zum Forumsbild darueber. */
  margin-bottom: 2rem;
}

/* Inhaltsbereich */
body.brand-v16-forum #content,
body.brand-v16-forum #content_noheader {
  background: var(--sgv16f-bg);
  border-left: 0;
  border-right: 0;
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum #content .xsmall,
body.brand-v16-forum #content .small,
body.brand-v16-forum #content .locked {
  color: var(--sgv16f-text-3);
}

/* Fussbereich (ehem. #bottom) */
body.brand-v16-forum .sgv16f-footer {
  background: var(--sgv16f-surface-2);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  color: var(--sgv16f-text-2);
}

/* ==========================================================================
   Stufe 2: Thread-/Post-Listen, Sidebar-Box, Formulare, Sortier-/Kategorieleiste
   + Kontrast-Audit: alle Textfarben, die auf den neuen dunklen Flaechen
   sonst dunkel-auf-dunkel waeren, sind hier explizit aufgehellt.
   Post-Karten (div.ct-posting) behalten bewusst ihren hellen Hintergrund,
   weil historische Beitraege teils fest codierte dunkle Schriftfarben aus
   BBCode enthalten - nur so bleibt jeder alte Beitrag sicher lesbar.
   ========================================================================== */

/* Datum ueber dem Thread-Titel (nur Standard-Listenansicht, Top-Level-Threads):
   eigene Zeile, Akzentfarbe. Der Titel-Wrapper <h2> hat "display:inline" als
   Inline-Style im Markup - Inline-Styles gewinnen immer gegen externes CSS,
   daher hier zwingend !important, um ihn auf eine eigene Zeile zu bringen. */
body.brand-v16-forum .thread-date {
  display: block;
  color: var(--sgv16f-yellow-text);
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: 0.85em;
}

body.brand-v16-forum .thread-post h2 {
  display: block !important;
  margin: 0.15em 0 0;
}

/* Thread-/Reply-Links (Index, Tabellenansicht, Suchergebnisse) */
body.brand-v16-forum a.thread,
body.brand-v16-forum a.thread:link,
body.brand-v16-forum a.thread-sticky,
body.brand-v16-forum a.thread-sticky:link,
body.brand-v16-forum a.thread-sticky-locked,
body.brand-v16-forum a.thread-sticky-locked:link,
body.brand-v16-forum a.thread-locked,
body.brand-v16-forum a.thread-locked:link,
body.brand-v16-forum a.thread100,
body.brand-v16-forum a.thread100:link {
  color: var(--sgv16f-text);
  font-family: "Atkinson Hyperlegible", sans-serif;
}

body.brand-v16-forum a.thread:visited,
body.brand-v16-forum a.thread-sticky:visited,
body.brand-v16-forum a.thread-sticky-locked:visited,
body.brand-v16-forum a.thread-locked:visited,
body.brand-v16-forum a.thread100:visited,
body.brand-v16-forum .visited {
  color: var(--sgv16f-text-3) !important;
}

body.brand-v16-forum a.thread:focus,
body.brand-v16-forum a.thread:hover,
body.brand-v16-forum a.thread-sticky:focus,
body.brand-v16-forum a.thread-sticky:hover,
body.brand-v16-forum a.thread-sticky-locked:focus,
body.brand-v16-forum a.thread-sticky-locked:hover,
body.brand-v16-forum a.thread-locked:focus,
body.brand-v16-forum a.thread-locked:hover,
body.brand-v16-forum a.thread100:hover {
  color: var(--sgv16f-yellow-text-hover);
}

/* "Neu"-Markierung: bekommt bewusst die Akzentfarbe, damit ungelesene Inhalte auffallen */
body.brand-v16-forum a.threadnew,
body.brand-v16-forum a.threadnew:link,
body.brand-v16-forum a.threadnew-sticky,
body.brand-v16-forum a.threadnew-sticky:link,
body.brand-v16-forum a.threadnew-sticky-locked,
body.brand-v16-forum a.threadnew-sticky-locked:link,
body.brand-v16-forum a.threadnew-locked,
body.brand-v16-forum a.threadnew-locked:link,
body.brand-v16-forum a.thread100new,
body.brand-v16-forum a.thread100new:link,
body.brand-v16-forum a.replynew,
body.brand-v16-forum a.replynew:link,
body.brand-v16-forum a.reply100new,
body.brand-v16-forum a.reply100new:link {
  color: var(--sgv16f-red);
  font-family: "Atkinson Hyperlegible", sans-serif;
}

/* Normale (bereits vorhandene, nicht neue) Antworten/Links: neutral statt aggressivem Rot als Default.
   a.reply/a.reply:link haben im Original ein !important auf color - das muss hier mitgehen,
   sonst gewinnt weiterhin das alte #cc0000. */
body.brand-v16-forum a.reply,
body.brand-v16-forum a.reply:link {
  color: var(--sgv16f-text-2) !important;
}

body.brand-v16-forum a.reply100,
body.brand-v16-forum a.reply100:link,
body.brand-v16-forum a.internal,
body.brand-v16-forum a.internal:link {
  color: var(--sgv16f-text-2);
}

/* Suchergebnisse / "letzte Beitraege" (mode=lastpostings): ungelesen = Signalrot
   wie .threadnew, gelesen bekommt die Klasse .visited (-> --sgv16f-text-3, oben). */
body.brand-v16-forum a.thread-search,
body.brand-v16-forum a.thread-search:link,
body.brand-v16-forum a.reply-search,
body.brand-v16-forum a.reply-search:link {
  color: var(--sgv16f-red);
  font-weight: 700;
}

body.brand-v16-forum a.thread-search:hover,
body.brand-v16-forum a.reply-search:hover {
  color: var(--sgv16f-red-hover);
}

body.brand-v16-forum a.threadnew:visited,
body.brand-v16-forum a.threadnew-sticky:visited,
body.brand-v16-forum a.threadnew-sticky-locked:visited,
body.brand-v16-forum a.threadnew-locked:visited,
body.brand-v16-forum a.thread100new:visited,
body.brand-v16-forum a.reply:visited,
body.brand-v16-forum a.replynew:visited,
body.brand-v16-forum a.reply100:visited,
body.brand-v16-forum a.reply100new:visited,
body.brand-v16-forum a.thread-search:visited,
body.brand-v16-forum a.reply-search:visited {
  color: var(--sgv16f-text-3);
}

body.brand-v16-forum a.threadnew:focus,
body.brand-v16-forum a.threadnew:hover,
body.brand-v16-forum a.threadnew-sticky:focus,
body.brand-v16-forum a.threadnew-sticky:hover,
body.brand-v16-forum a.threadnew-sticky-locked:focus,
body.brand-v16-forum a.threadnew-sticky-locked:hover,
body.brand-v16-forum a.threadnew-locked:focus,
body.brand-v16-forum a.threadnew-locked:hover,
body.brand-v16-forum a.thread100new:hover,
body.brand-v16-forum a.replynew:focus,
body.brand-v16-forum a.replynew:hover,
body.brand-v16-forum a.reply100new:hover {
  color: var(--sgv16f-red-hover);
}

body.brand-v16-forum a.reply:focus,
body.brand-v16-forum a.reply:hover,
body.brand-v16-forum a.reply100:hover,
body.brand-v16-forum a.internal:hover {
  color: var(--sgv16f-yellow-text-hover);
}

body.brand-v16-forum a.read,
body.brand-v16-forum a.read:link,
body.brand-v16-forum a.read:visited,
body.brand-v16-forum #latest-postings li a span.read {
  color: var(--sgv16f-text-3) !important;
}

body.brand-v16-forum a.read:focus,
body.brand-v16-forum a.read:hover {
  color: var(--sgv16f-yellow-text-hover) !important;
}

/* Kategorie-Labels */
body.brand-v16-forum .category,
body.brand-v16-forum .category-b,
body.brand-v16-forum .category-regusers-b,
body.brand-v16-forum .category-adminmod-b,
body.brand-v16-forum ul.thread li .replies {
  color: var(--sgv16f-text-3);
}

body.brand-v16-forum .category-regusers,
body.brand-v16-forum .category-adminmod {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text-3);
}

/* Vorschau-Box im Posting-Formular */
body.brand-v16-forum div.preview {
  color: var(--sgv16f-text);
}

/* Sidebar-Box: letzte Eintraege / Tag-Cloud / Mod-Menue / Online-Nutzer.
   style.css setzt auf jedes Widget einzeln "margin:0 0 20px 20px" (Relikt aus
   der alten schmalen Float-Sidebar) - dadurch war der Abstand nur links und
   unten vorhanden, rechts/oben bei 0. Hier auf reinen Bottom-Abstand
   reduziert, das horizontale Insets uebernimmt stattdessen einheitlich das
   Padding auf #sidebar selbst (siehe Grid-Abschnitt weiter unten) - dieselbe
   Systematik wie bei .sgv16f-thread-stream, damit beide Spalten gleich
   wirken. */
body.brand-v16-forum #latest-postings,
body.brand-v16-forum #tagcloud,
body.brand-v16-forum #modmenu,
body.brand-v16-forum #usersonline,
body.brand-v16-forum #bottombar #sidebarcontent div {
  background: var(--sgv16f-surface);
  border: 1px solid var(--sgv16f-surface-2);
  margin: 0 0 1rem;
  /* style.css setzt #latest-postings/#tagcloud/#modmenu auf feste 13em (~233px) -
     dadurch blieb rechts in der 300px-Sidebar-Spalte Freiraum. Box fuellt jetzt
     die volle Spaltenbreite, damit sie buendig mit der Kategorie-Nav abschliesst. */
  width: auto;
  box-sizing: border-box;
}

body.brand-v16-forum #latest-postings h3,
body.brand-v16-forum #tagcloud h3,
body.brand-v16-forum #modmenu h3,
body.brand-v16-forum #usersonline h3,
body.brand-v16-forum #bottombar h3 {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-yellow-text);
  font-family: "Barlow Semi Condensed", sans-serif;
  border: 0;
}

body.brand-v16-forum #usersonline p,
body.brand-v16-forum #tagcloud p {
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum #tagcloud strong {
  color: var(--sgv16f-yellow-text);
}

body.brand-v16-forum #latest-postings li a {
  color: var(--sgv16f-text-3);
}

body.brand-v16-forum #latest-postings li a:hover {
  background: var(--sgv16f-surface-2);
}

body.brand-v16-forum #latest-postings li a span,
body.brand-v16-forum #latest-postings li a .entry-title {
  color: var(--sgv16f-text);
}

body.brand-v16-forum #latest-postings li a:visited span,
body.brand-v16-forum #latest-postings li a:visited .entry-title,
body.brand-v16-forum #latest-postings li a.read .entry-title {
  color: var(--sgv16f-text-3);
}

body.brand-v16-forum #latest-postings li a .entry-date,
body.brand-v16-forum #latest-postings li a.read .entry-date {
  color: var(--sgv16f-text-3);
}

body.brand-v16-forum #bottombar .latestposts a:visited {
  color: var(--sgv16f-text-3);
}

/* Tabellenansicht (Threadliste) + Formulare, beide nutzen table.normaltab */
body.brand-v16-forum table.normaltab {
  background: var(--sgv16f-bg);
  border: 1px solid var(--sgv16f-surface-2);
}

body.brand-v16-forum table.normaltab th {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text);
  border-bottom: 2px solid var(--sgv16f-line);
  font-family: "Barlow Semi Condensed", sans-serif;
}

body.brand-v16-forum table.normaltab td,
body.brand-v16-forum table.normaltab tr.a td,
body.brand-v16-forum table.normaltab td.d {
  background: var(--sgv16f-bg);
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum table.normaltab tr.b td {
  background: var(--sgv16f-surface);
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum table.normaltab td.c {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum table.normaltab tr.drag td {
  background: var(--sgv16f-surface-2);
}

/* Seitennummerierung */
body.brand-v16-forum ul.pagination a,
body.brand-v16-forum ul.pagination span {
  background: var(--sgv16f-surface-2);
  border: 1px solid var(--sgv16f-surface-2);
  color: var(--sgv16f-text);
}

body.brand-v16-forum ul.pagination a:hover {
  background: var(--sgv16f-surface);
  border-color: var(--sgv16f-yellow);
  color: var(--sgv16f-text);
}

body.brand-v16-forum ul.pagination .current {
  background: var(--sgv16f-yellow);
  border-color: var(--sgv16f-yellow);
  color: var(--sgv16f-yellow-ink);
}

/* Sortier-/Kategorieleiste (#topnav rechts: Refresh, Sortierung, Ansicht, Kategorie-Auswahl) */
body.brand-v16-forum #topnav select,
body.brand-v16-forum #subnav select {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text);
  border: 1px solid var(--sgv16f-surface-2);
}

/* Formulare: Eingabefelder, Auswahllisten, Buttons (Login, Registrierung, Posting, Profil) */
body.brand-v16-forum input[type="text"],
body.brand-v16-forum input[type="password"],
body.brand-v16-forum input[type="email"],
body.brand-v16-forum input[type="search"],
body.brand-v16-forum input[type="number"],
body.brand-v16-forum input:not([type]),
body.brand-v16-forum textarea,
body.brand-v16-forum select {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text);
  border: 1px solid var(--sgv16f-surface-2);
  border-radius: 0;
}

/* Native Select-Widgets ignorieren teils background-color, solange appearance:auto aktiv ist.
   Der Pfeil braucht je nach Modus einen dunklen bzw. hellen Fill - passend zur Textfarbe. */
body.brand-v16-forum select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 1.6em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23121212' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .4em center;
  background-size: .6em;
}

@media (prefers-color-scheme: dark) {
  body.brand-v16-forum select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23F5F5F5' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  }
}

body.brand-v16-forum input[type="text"]:focus,
body.brand-v16-forum input[type="password"]:focus,
body.brand-v16-forum input[type="email"]:focus,
body.brand-v16-forum input[type="search"]:focus,
body.brand-v16-forum input[type="number"]:focus,
body.brand-v16-forum input:not([type]):focus,
body.brand-v16-forum textarea:focus,
body.brand-v16-forum select:focus,
body.brand-v16-forum #search_top:focus,
body.brand-v16-forum #topsearch #search-input:focus {
  color: var(--sgv16f-text) !important;
  outline: 2px solid var(--sgv16f-yellow);
  outline-offset: 1px;
}

body.brand-v16-forum input[type="checkbox"],
body.brand-v16-forum input[type="radio"] {
  accent-color: var(--sgv16f-yellow);
}

body.brand-v16-forum button,
body.brand-v16-forum input[type="submit"],
body.brand-v16-forum input[type="button"] {
  background: var(--sgv16f-yellow);
  color: var(--sgv16f-yellow-ink);
  border: 1px solid var(--sgv16f-yellow);
  border-radius: 0;
  font-weight: 700;
}

body.brand-v16-forum button:hover,
body.brand-v16-forum input[type="submit"]:hover,
body.brand-v16-forum input[type="button"]:hover {
  background: var(--sgv16f-yellow-hover);
  border-color: var(--sgv16f-yellow-hover);
}

/* BBCode-Werkzeugleiste im Editor: eigene, dezente Darstellung statt Browser-Standard */
body.brand-v16-forum #bbcode-bar button {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text);
  border: 1px solid var(--sgv16f-surface-2);
}

body.brand-v16-forum #bbcodebutton-link span {
  color: var(--sgv16f-red);
}

/* Formular-Labels (Benachrichtigungs-/Profileinstellungen) */
body.brand-v16-forum label.active,
body.brand-v16-forum fieldset.active label,
body.brand-v16-forum fieldset.active input {
  color: var(--sgv16f-text);
}

body.brand-v16-forum label.inactive,
body.brand-v16-forum label.inactive input,
body.brand-v16-forum fieldset.inactive label,
body.brand-v16-forum fieldset.inactive input {
  color: var(--sgv16f-text-3) !important;
}

/* Post-Karten: bewusst hell, siehe Kommentar am Blockanfang. Nur Rahmenfarbe ans Theme angleichen. */
body.brand-v16-forum div.ct-posting {
  border-left-color: var(--sgv16f-yellow);
}

/* Frei waehlbare Benutzernamenfarben (aus der Registrierung, z.B. "color: #000000"):
   Die Farbe selbst kommt aus der Datenbank und ist nicht generell dunkel oder hell.
   Ein kleines Skript (main.tpl) misst die tatsaechliche Helligkeit jeder Namensfarbe
   und setzt die Klasse "sgv16f-dark-username" NUR, wenn die Farbe auf dunklem
   Hintergrund unlesbar waere. Nur diese bekommen den hellen Hintergrund-Chip -
   Namen mit ohnehin heller Farbe bleiben unveraendert ohne Chip. */
body.brand-v16-forum .sgv16f-dark-username {
  background: var(--sgv16f-text);
  padding: 0 .3em;
  border-radius: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ==========================================================================
   Schrift-Vereinheitlichung: nur die zwei Fonts, die auch die Hauptseite
   verwendet (Atkinson Hyperlegible fuer Fliesstext/UI, Barlow Semi Condensed
   fuer Ueberschriften/Labels). style.css setzt an mehreren Stellen explizit
   verdana/Arial/Helvetica/Courier New, was sonst die Vererbung vom
   body-Font unterbricht - hier einzeln auf die zwei Fonts zurueckgefuehrt.
   ========================================================================== */
body.brand-v16-forum table.normaltab td.a,
body.brand-v16-forum table.normaltab td.b,
body.brand-v16-forum table.normaltab td.c,
body.brand-v16-forum table.normaltab td.d,
body.brand-v16-forum #search_top,
body.brand-v16-forum input.small,
body.brand-v16-forum select.small,
body.brand-v16-forum #topsearch #search-input,
body.brand-v16-forum .newsframe,
body.brand-v16-forum .newsframefett,
body.brand-v16-forum code,
body.brand-v16-forum code.monospace,
body.brand-v16-forum blockquote code,
body.brand-v16-forum #bbcodebutton-code span {
  font-family: "Atkinson Hyperlegible", sans-serif;
}

/* SunEditor (Redaktions-/Adminbereich, mode=admin): eigenes Bundle (suneditor.css)
   bleibt unveraendert, wird hier per Overlay statt Datei-Aenderung auf die
   Hauptseiten-Fonts umgestellt. */
body.brand-v16-forum .sun-editor,
body.brand-v16-forum .sun-editor-editable {
  font-family: "Atkinson Hyperlegible", sans-serif;
}

/* News-Box ("Aktuelle Artikel bei schwatzgelb.de"): Standardschrift etwas
   groesser als das Original (12px/11px). Die Linkfarbe im Newsframe-Titel
   ist im Light Mode schwarz statt gelb - im Dark Mode bleibt sie gelb wie
   der globale Link-Standard (Ueberschreibung in der @media-Regel oben). */
body.brand-v16-forum .newsframe {
  font-size: 14px;
}

body.brand-v16-forum .newsframefett {
  font-size: 13px;
}

body.brand-v16-forum .newsframe a {
  color: var(--sgv16f-text);
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
}

body.brand-v16-forum .sgv16f-headerbox-news-title {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 .5rem;
}

@media (prefers-color-scheme: dark) {
  body.brand-v16-forum .newsframe a {
    color: var(--sgv16f-yellow);
  }
}

/* News-Box (#headerbox > .sgv16f-headerbox-inner): Bild- und Textspalte waren
   im Markup frueher per Inline-Style "width:50%; float:left/right" fest
   gesetzt (jetzt sgv16f-headerbox-media/-news).
   display:flex steckt bewusst in einer eigenen @media-Regel (min-width:961px):
   style.css blendet .headerbox (per Klasse, die auf demselben Element wie
   .sgv16f-headerbox-inner sitzt) unter 960px komplett aus (display:none), und
   unsere Selektor-Spezifitaet waere sonst staerker als die des Originals und
   wuerde das Ausblenden auf Mobilgeraeten kaputt machen. */
body.brand-v16-forum .sgv16f-headerbox-inner {
  padding-top: .95rem;
}

@media (min-width: 961px) {
  body.brand-v16-forum .sgv16f-headerbox-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
  }
}

/* Bildspalte: fester 16:9-Rahmen, halbe verfuegbare Breite. Das Quellbild wird
   nach HOEHE skaliert und mittig gesetzt (object-fit: contain) - passt das
   Seitenverhaeltnis nicht, entsteht links/rechts (bzw. oben/unten) Freiraum in
   der Flaechenfarbe statt eines Beschnitts. PHP liefert <amp-img layout="fill"
   object-fit="contain">. */
body.brand-v16-forum .sgv16f-headerbox-media {
  flex: 0 0 50%;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sgv16f-surface);
}

body.brand-v16-forum .sgv16f-headerbox-media-inner,
body.brand-v16-forum .sgv16f-headerbox-media a.randomimage,
body.brand-v16-forum .sgv16f-headerbox-media amp-img {
  display: block;
  width: 100%;
  height: 100%;
}

body.brand-v16-forum .sgv16f-headerbox-media img,
body.brand-v16-forum .sgv16f-headerbox-media amp-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.brand-v16-forum .sgv16f-headerbox-news {
  flex: 1 1 260px;
  min-width: 0;
  text-align: left;
}

/* ==========================================================================
   Grid-Layout: #content (Thread-Liste/Tabelle + Sidebar), mobile-first.
   Basis (Mobile, keine Media Query): eine Spalte, alle Kinder untereinander -
   identisch zur bisherigen Darstellung. #sidebar/#bottombar werden unterhalb
   769px weiterhin von style.css per display:none ausgeblendet (unveraendert).
   Ab 769px (genau der Breakpoint, ab dem style.css die Sidebar ueberhaupt
   erst einblendet) wird daraus ein echtes 2-Spalten-Grid statt des alten
   Floats - sowohl in der Listenansicht (#sidebar, index.inc.tpl) als auch in
   der Tabellenansicht (#bottombar, index_table.inc.tpl - dort vorher immer
   volle Breite UNTER der Tabelle statt daneben). */
body.brand-v16-forum #content:has(> #sidebar),
body.brand-v16-forum #content:has(> #bottombar) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 769px) {
  body.brand-v16-forum #content:has(> #sidebar),
  body.brand-v16-forum #content:has(> #bottombar) {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    column-gap: 2rem;
  }

  /* top:0 (statt z.B. 1rem): Chrome wendet den sticky top-Offset bei
     Grid-Items schon in der Ausgangsposition an (nicht erst beim tatsaechlichen
     "Kleben" ab dem Scroll-Schwellwert) - jeder Wert > 0 verschiebt die Sidebar
     dadurch bereits beim Laden sichtbar nach unten und sie startet nicht mehr
     auf gleicher Hoehe wie .sgv16f-thread-stream in Spalte 1. */
  body.brand-v16-forum #content:has(> #sidebar) > #sidebar,
  body.brand-v16-forum #content:has(> #bottombar) > #bottombar {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    margin: 0;
  }

  body.brand-v16-forum #content:has(> #sidebar) > :not(#sidebar),
  body.brand-v16-forum #content:has(> #bottombar) > :not(#bottombar) {
    grid-column: 1;
  }
}

body.brand-v16-forum .sgv16f-thread-stream {
  padding: 1rem 2px;
}

/* Lineare / hierarchische Thread-Ansicht nutzt .ct-thread statt .sgv16f-thread-stream */
body.brand-v16-forum .ct-thread {
  padding: 0 2px;
}

/* Vertikales Innen-Padding wie .sgv16f-thread-stream. Horizontal 0, damit die
   Spalten buendig mit Header/Nav/Content-Kante abschliessen. */
body.brand-v16-forum #sidebar,
body.brand-v16-forum #bottombar {
  box-sizing: border-box;
  padding: 1rem 0;
}

/* Jeder Thread als eigene Flaeche auf dem Grid */
body.brand-v16-forum .thread-post {
  background: var(--sgv16f-surface);
}

/* ==========================================================================
   Stufe 3: Header-/Nav-Redesign, mobile-first, ohne separates Mobile-Duplikat.
   Ersetzt den bisherigen .mobilenav-Block + das getrennte Desktop-Header/
   #headtop/#topnav-Trio (float/position:absolute) durch EINE Struktur:
   <header class="sgv16f-header"> (Logo/Textgroesse/Suche + Konto-Zeile) und
   <nav class="sgv16f-catnav"> (Kategorien/Ansicht, im Kopf- wie im Fussbereich).
   Account-/Meta-Links bleiben auf allen Breiten sichtbar und brechen per
   Flexbox-Wrap um - kein <details>, kein JS-Toggle. Suche ist jetzt auf allen
   Breiten erreichbar (vorher unter 768px komplett display:none, das war nur
   eine Nebenwirkung des alten position:absolute-Layouts).
   Basis (keine Media Query) = Mobile, danach min-width:769px - derselbe
   Breakpoint wie beim Content-Grid oben, damit Header und Content gemeinsam
   umschalten.
   ========================================================================== */

/* Gemeinsame Breite/Ausrichtung fuer Header, Content und Footer (vorher
   uneinheitlich: .header/#headtop/#topnav/#headerbox/#bottomnav/#bottom hatten
   1280px, #content 1240px - dadurch standen die Bereiche nicht buendig
   untereinander). border-left/right bleibt an allen Containern erhalten. */
body.brand-v16-forum .sgv16f-header,
body.brand-v16-forum .sgv16f-utility-nav,
body.brand-v16-forum .sgv16f-catnav,
body.brand-v16-forum #headerbox,
body.brand-v16-forum #content,
body.brand-v16-forum .sgv16f-footer {
  /* border-box statt des style.css-Standards (content-box): die Bereiche haben
     unterschiedlich viel eigenes Padding (#content z.B. 20px aus style.css,
     der neue Header/Footer 16px) - bei content-box wuerde max-width nur die
     Content-Box begrenzen und das Padding oben draufkommen, wodurch die
     Aussenkanten trotz gleichem max-width leicht auseinanderlaufen. */
  box-sizing: border-box;
  max-width: var(--sgv16f-container-max);
  margin-left: auto;
  margin-right: auto;
  /* Nur ein Hauch horizontaler Innenabstand (2px), damit randnahe Elemente wie
     das Datum nicht direkt an der Kante kleben - alle sechs Bereiche (Header,
     Konto-Nav, Kategorie-Nav, News-Box, Content, Footer) behalten dieselbe
     Kante und Breite. Vertikales Padding bleibt je Bereich unterschiedlich. */
  padding-left: 2px;
  padding-right: 2px;
}

/* Alte style.css-Regel `.header,#subnav-1,#subnav-2,#subnav-3,#subnav-4,#headtop
   { display:none }` bei max-width:768px (style.css:3117-3121) blendete den
   kompletten Desktop-Header auf Mobile aus - das war die Existenzgrundlage des
   separaten .mobilenav-Blocks. Die neue Struktur soll aber auf ALLEN Breiten
   dieselbe sein, daher wird die Regel hier unconditional (keine Media Query)
   neutralisiert. Die Selektoren mit body.brand-v16-forum-Praefix sind
   spezifischer als die reinen style.css-Selektoren und gewinnen daher
   unabhaengig von Ladereihenfolge/Media Query, kein !important noetig. */
body.brand-v16-forum .sgv16f-header,
body.brand-v16-forum .sgv16f-utility-nav {
  display: flex;
}

/* #subnav-1/#subnav-3 ("neues Thema" o.ae., subnavigation_1.inc.tpl) bleiben
   normale Block-Boxen. #subnav-2/#subnav-4 (subnavigation_2.inc.tpl) werden
   weiter unten ueber .sgv16f-catnav-right explizit zur Tab-Leiste (display:flex,
   siehe dortiger Kommentar) - hier daher bewusst nicht mit aufgefuehrt, sonst
   wuerde diese ID-Regel (gleiche Spezifitaet, aber zuerst im Stylesheet) das
   spaetere display:flex nicht zuverlaessig gewinnen lassen. */
body.brand-v16-forum #subnav-1,
body.brand-v16-forum #subnav-3 {
  display: block;
}

/* Suche auf allen Breiten erreichbar (Entscheidung aus dem Umsetzungsplan):
   style.css blendet .searchbox unter 768px zusammen mit #sidebar/#title1/
   .ajax_preview aus - hier gezielt NUR .searchbox davon ausnehmen. */
body.brand-v16-forum .searchbox {
  display: block;
}

/* Header enthaelt nur noch das Logo - zentriert statt frueher per
   margin:auto auf .logobox innerhalb eines position:absolute-umzingelten
   Headers. */
body.brand-v16-forum .sgv16f-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: .75rem;
  padding-bottom: .75rem;
}

/* Suchfeld: vorher position:absolute;right:0;width:250px aus style.css.
   Mobile: Teil des Overlay-Menus (sgv16f-utility-links), erste Zeile darin,
   volle Breite. Ab 769px: kein Overlay mehr noetig, Suche wird per order
   innerhalb von .sgv16f-utility-links nach rechts geschoben (margin-left:auto),
   die Konto-/Meta-Listen bleiben links. */
body.brand-v16-forum .sgv16f-search {
  position: static;
  width: 100%;
  max-width: none;
  padding-left: 0;
  margin-bottom: .5rem;
}

body.brand-v16-forum .sgv16f-search #search_top {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  body.brand-v16-forum .sgv16f-search {
    order: 2;
    width: auto;
    /* rechts angedockt in derselben Zeile wie .sgv16f-utility-left; min-width:0
       laesst das Feld bei wenig Platz schrumpfen statt in eine eigene Zeile zu
       brechen. align-self:center gleicht die 3px Hoehenversatz zur Linkliste aus. */
    flex: 0 1 20rem;
    min-width: 0;
    margin-left: auto;
    margin-bottom: 0;
    align-self: center;
  }
}

/* Konto-/Suche-/Metaleiste (ehem. #headtop, float:left/text-align:right).
   Eigenstaendige Zeile zwischen Header und Kategorie-Nav.
   Mobile: Zeile 1 = nur der Toggle-Button (rechtsbuendig). Zeile 2 (per
   Checkbox-Hack ein-/ausklappbar, kein JS) = Suche + Konto-/Meta-Links als
   Overlay-Menu darunter, jeder Punkt eine eigene Zeile. Ab 769px: Toggle
   verschwindet, Suche+Links sind immer sichtbar, Suche rechts, Listen links. */
body.brand-v16-forum .sgv16f-utility-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

body.brand-v16-forum .sgv16f-utility-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.brand-v16-forum .sgv16f-utility-toggle-btn {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  background: var(--sgv16f-surface-2);
  border: 1px solid var(--sgv16f-surface-2);
}

body.brand-v16-forum .sgv16f-utility-toggle-icon,
body.brand-v16-forum .sgv16f-utility-toggle-icon::before,
body.brand-v16-forum .sgv16f-utility-toggle-icon::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--sgv16f-text);
}

body.brand-v16-forum .sgv16f-utility-toggle-icon {
  position: relative;
}

body.brand-v16-forum .sgv16f-utility-toggle-icon::before,
body.brand-v16-forum .sgv16f-utility-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

body.brand-v16-forum .sgv16f-utility-toggle-icon::before {
  top: -.4rem;
}

body.brand-v16-forum .sgv16f-utility-toggle-icon::after {
  top: .4rem;
}

/* Overlay-Menu: per Default (Checkbox nicht angehakt) komplett ausgeblendet,
   auf einer eigenen vollen Zeile unterhalb von .sgv16f-utility-nav, sobald es
   (via :checked) sichtbar geschaltet wird - Suche + beide Listen darin. */
body.brand-v16-forum .sgv16f-utility-links {
  display: none;
  width: 100%;
  padding-top: .5rem;
  padding-bottom: 1rem;
}

body.brand-v16-forum .sgv16f-utility-toggle-input:checked ~ .sgv16f-utility-links {
  display: block;
}

/* Unsortierte Liste: jeder Menuepunkt eine eigene Zeile (Mobile-Overlay). */
body.brand-v16-forum .sgv16f-utility-left,
body.brand-v16-forum .sgv16f-utility-right {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.brand-v16-forum .sgv16f-utility-left li,
body.brand-v16-forum .sgv16f-utility-right li {
  margin: 0 0 .35rem;
}

body.brand-v16-forum .sgv16f-utility-left a.menuelink,
body.brand-v16-forum .sgv16f-utility-right a.menuelink {
  display: inline-block;
}

@media (min-width: 769px) {
  body.brand-v16-forum .sgv16f-utility-toggle-input,
  body.brand-v16-forum .sgv16f-utility-toggle-btn {
    display: none;
  }

  body.brand-v16-forum .sgv16f-utility-links {
    display: flex !important;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem 1rem;
    width: auto;
    padding: 0;
  }

  body.brand-v16-forum .sgv16f-utility-left,
  body.brand-v16-forum .sgv16f-utility-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .75rem;
  }

  body.brand-v16-forum .sgv16f-utility-left li,
  body.brand-v16-forum .sgv16f-utility-right li {
    margin: 0;
  }
}

/* Kategorien-/Ansichts-Nav (ehem. getrennt #topnav/#bottomnav, float:left/
   text-align:right).
   Mobile: durchgehende Tab-Leiste. .sgv16f-catnav-left ("neues Thema",
   subnavigation_1.inc.tpl im Index-Modus) ist gepinnt/schrumpft nicht und
   bleibt immer sichtbar; .sgv16f-catnav-right (subnavigation_2.inc.tpl:
   Sortierung/Einklappen/Ansicht/Kategorie/Pagination) wird zur horizontal
   slidebaren Tab-Reihe (flex, nowrap, overflow-x:auto), die Kind-Elemente
   schrumpfen nicht, sondern liegen nebeneinander und werden weggeschoben.
   Ab 769px: zurueck zum normalen, umbrechenden Zeilenlayout wie zuvor. */
body.brand-v16-forum .sgv16f-catnav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .5rem 1rem;
  padding-top: .4rem;
  padding-bottom: .4rem;
}

body.brand-v16-forum .sgv16f-catnav-left {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: left;
  padding: 0;
  margin: 0;
}

/* #subnav-2/#subnav-4 zusaetzlich zur Klasse aufgefuehrt: style.css blendet
   diese IDs bei max-width:768px per display:none aus (gleiche Spezifitaet
   wie eine reine ID-Regel) - eine reine Klassen-Regel waere dagegen NICHT
   spezifisch genug und wuerde verlieren, siehe Kommentar weiter oben bei
   #subnav-1/#subnav-3. */
body.brand-v16-forum .sgv16f-catnav-right,
body.brand-v16-forum #subnav-2,
body.brand-v16-forum #subnav-4 {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  text-align: left;
  padding: 0;
  margin: 0;
}

body.brand-v16-forum .sgv16f-catnav-right::-webkit-scrollbar {
  display: none;
}

body.brand-v16-forum .sgv16f-catnav-right > * {
  flex: 0 0 auto;
}

@media (min-width: 769px) {
  body.brand-v16-forum .sgv16f-catnav {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  /* #subnav-2/#subnav-4 mitfuehren: als ID-Selektor (Spezifitaet 1,1,1)
     schlaegt die Basisregel oben sonst diese Klassenregel (0,2,1) und die
     Fuss-Navigation bliebe overflow-x:auto + nowrap -> Paginierungs-Formular
     abgeschnitten. */
  body.brand-v16-forum .sgv16f-catnav-right,
  body.brand-v16-forum #subnav-2,
  body.brand-v16-forum #subnav-4 {
    flex-wrap: wrap;
    overflow-x: visible;
    min-width: 0;
  }
}

/* Fussbereich (ehem. #bottom, div.left/div.right ohne Flex), jetzt zwei
   Reihen: oben die Forumsdaten (Anzahl Themen/Eintraege, Uhrzeit), darunter
   die Rechtstexte/RSS-Links als eigene Tab-Reihe. */
body.brand-v16-forum .sgv16f-footer {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

body.brand-v16-forum .sgv16f-footer-stats {
  text-align: left;
}

body.brand-v16-forum .sgv16f-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

body.brand-v16-forum .sgv16f-footer-links a {
  display: inline-flex;
  align-items: center;
  padding: .3rem .6rem;
  background: var(--sgv16f-surface-2);
  white-space: nowrap;
}

body.brand-v16-forum .sgv16f-footer-links a img {
  margin-right: .35rem;
}

/* ==========================================================================
   Stufe 4: Kontrast-Haertung - stringentes Light/Dark fuer BEIDE Thread-
   Ansichten (linear = thread_linear.inc.tpl / .ct-*, hierarchisch =
   thread.inc.tpl / .thread-posting), Einzelbeitrag, Editor-Popovers und
   Benutzernamen in ALLEN Ansichten (Index, Board, Thread, Suche, Online).
   style.css setzt auf den Beitragsflaechen feste helle Hintergruende ohne
   Dark-Variante; im Dark Mode stand dort die aufgehellte Token-Schrift auf
   Weiss (~1.4:1). Diese Flaechen bekommen hier echte Theme-Hintergruende,
   die Schrift zieht ueber die Token nach. Fest kodierte dunkle Schrift aus
   Alt-Beitraegen wird zusaetzlich zur Laufzeit aufgehellt (main.tpl).
   ========================================================================== */

/* --- Beitragsflaechen: Theme-Hintergrund statt hartkodiertem #fff / #f5f5f5 --- */
body.brand-v16-forum div.ct-posting,
body.brand-v16-forum .thread-posting {
  background: var(--sgv16f-surface);
  color: var(--sgv16f-text-2);
  border-color: var(--sgv16f-surface-2);
  border-left-color: var(--sgv16f-yellow);
}

body.brand-v16-forum div.ct-postinghead,
body.brand-v16-forum .thread-posting .header {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum div.ct-postinghead img.avatar,
body.brand-v16-forum .thread-posting .header img.avatar {
  background: var(--sgv16f-surface-2);
}

/* Autorenspalte der linearen Ansicht: <td bgcolor="#F5F5F5"> im Markup
   (thread_linear.inc.tpl) - Praesentationsattribut, das jede CSS-Regel schlaegt. */
body.brand-v16-forum .ct-thread td[bgcolor],
body.brand-v16-forum .postingcontainer td[bgcolor],
body.brand-v16-forum .ct-postinghead td[bgcolor] {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum .ct-postingbody,
body.brand-v16-forum .thread-posting .body,
body.brand-v16-forum p.ct-author,
body.brand-v16-forum .thread-posting .author,
body.brand-v16-forum .posting .author {
  color: var(--sgv16f-text-2);
}

body.brand-v16-forum .ct-postingbody a,
body.brand-v16-forum .thread-posting .body a,
body.brand-v16-forum p.ct-author a,
body.brand-v16-forum .thread-posting .author a {
  color: var(--sgv16f-text);
}

/* Popup + Editor-Popover (Schriftgroesse / Code / BBCode-Optionen) */
body.brand-v16-forum .popup,
body.brand-v16-forum #sizepicker,
body.brand-v16-forum #codepicker,
body.brand-v16-forum #bbcode-options,
body.brand-v16-forum #bbcode-options div {
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text);
}

body.brand-v16-forum #sizepicker p a:hover,
body.brand-v16-forum #codepicker p a:hover {
  background: var(--sgv16f-surface);
}

/* Sidebar-Ueberschriften: Gold auf #EBEBEB nur 4.1:1 -> Theme-Textfarbe (>= 13:1) */
body.brand-v16-forum #latest-postings h3,
body.brand-v16-forum #tagcloud h3,
body.brand-v16-forum #modmenu h3,
body.brand-v16-forum #usersonline h3,
body.brand-v16-forum #bottombar h3 {
  color: var(--sgv16f-text);
  border-left: 3px solid var(--sgv16f-yellow);
}

/* --- Sekundaertext in Beitraegen: >= 4.5:1 in beiden Modi --- */
body.brand-v16-forum .ago,
body.brand-v16-forum .edited,
body.brand-v16-forum .op-link,
body.brand-v16-forum .op-link a,
body.brand-v16-forum #content p.tags,
body.brand-v16-forum #content p.signature,
body.brand-v16-forum .posting-footer .locked,
body.brand-v16-forum .posting-footer .views {
  color: #5c5c5c;
}

@media (prefers-color-scheme: dark) {
  body.brand-v16-forum .ago,
  body.brand-v16-forum .edited,
  body.brand-v16-forum .op-link,
  body.brand-v16-forum .op-link a,
  body.brand-v16-forum #content p.tags,
  body.brand-v16-forum #content p.signature,
  body.brand-v16-forum .posting-footer .locked,
  body.brand-v16-forum .posting-footer .views {
    color: var(--sgv16f-text-3);
  }

  /* Zitate / Code im Beitrag (style.css: #6f6f6f / #000080 - im Dark Mode < 1.5:1) */
  body.brand-v16-forum #content .quote,
  body.brand-v16-forum #content blockquote,
  body.brand-v16-forum #content blockquote code {
    color: #A9AEB4;
  }

  body.brand-v16-forum #content code,
  body.brand-v16-forum #content code.monospace {
    color: #A9C7FF;
  }
}

/* --- Benutzernamen: einheitlich in Index, Board, Thread, Suche, Online --- */
/* style.css faerbt span.admin / span.mod #FCCA01 (1.5:1 auf hellem Grund) */
body.brand-v16-forum span.admin,
body.brand-v16-forum span.mod {
  color: var(--sgv16f-yellow-text);
  font-weight: 700;
}

/* " (R)"-Zeichen hinter Staff-Namen (thread_linear.inc.tpl: inline rgb(204,204,153)) */
body.brand-v16-forum .ct-author span[style*="204, 204, 153"],
body.brand-v16-forum .ct-author span[style*="204,204,153"] {
  color: var(--sgv16f-yellow-text) !important;
}

/* Admin-Tabellen (mode=admin, Userfreischaltung/Userliste) und "letzte
   Beitraege" (mode=lastpostings, ul.searchresults): Namen kommen als
   <span style="color:#000000"> -> im Dark Mode unsichtbar. Fester Schwarzwert
   wird ueberschrieben; frei gewaehlte Farben regelt das Skript in main.tpl. */
@media (prefers-color-scheme: dark) {
  body.brand-v16-forum #content table.normaltab td span[style*="#000000"],
  body.brand-v16-forum #content table.normaltab td span[style*="#000"],
  body.brand-v16-forum #content table.normaltab td span[style*="rgb(0, 0, 0)"],
  body.brand-v16-forum #content ul.searchresults span[style*="#000000"],
  body.brand-v16-forum #content ul.searchresults span[style*="#000"],
  body.brand-v16-forum #content ul.searchresults span[style*="rgb(0, 0, 0)"] {
    color: var(--sgv16f-text) !important;
  }
}

/* Postueberschrift der linearen Ansicht: Basisfarbe setzen (Inline-onmouseover/-out
   auf #000080/#000 entfernt das Skript in main.tpl). */
body.brand-v16-forum h1.postingheadline {
  color: var(--sgv16f-text);
}

/* Aktionsleiste unter Beitraegen (.posting-footer .options bzw. entry.inc.tpl
   .nav .options): der frueher inline im Template gesetzte weisse Kasten mit
   float ist entfernt - hier einheitliche, modusfaehige Pill-Buttons. Die
   Icon-Sprites (dunkle PNGs) werden abgeschaltet, da im Dark Mode unsichtbar. */
body.brand-v16-forum .posting-footer .nav {
  float: none;
  padding: 0;
  color: inherit;
}

body.brand-v16-forum .posting-footer .options,
body.brand-v16-forum .posting-footer .nav ul.options {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .6rem 0 0;
  padding: 0;
  list-style: none;
  /* style.css erzwingt hier 0.69em !important - gleiche Groesse wie .reply
     ("antworten", 0.82em) wollen, daher ebenfalls !important. */
  font-size: 0.82em !important;
  max-width: none;
}

body.brand-v16-forum .posting-footer .options li {
  float: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: none;
}

/* #content .small (Spezifitaet 1,1,0) setzt sonst wieder 0.69em auf die
   inneren <span>/<a>. 1em je Ebene = kein Compounding, Endgroesse = 0.82em. */
body.brand-v16-forum .posting-footer .options li,
body.brand-v16-forum .posting-footer .options li span,
body.brand-v16-forum .posting-footer .options li a {
  font-size: 1em !important;
}

body.brand-v16-forum .posting-footer .options li a,
body.brand-v16-forum .posting-footer .options li span.small a {
  display: inline-block;
  padding: .25rem .55rem;
  background: var(--sgv16f-surface-2);
  color: var(--sgv16f-text);
  border: 1px solid var(--sgv16f-surface-2);
  border-radius: 0;
  font-weight: 700;
  text-decoration: none;
  background-image: none;
}

body.brand-v16-forum .posting-footer .options li a:hover,
body.brand-v16-forum .posting-footer .options li a:focus,
body.brand-v16-forum .posting-footer .options li span.small a:hover {
  border-color: var(--sgv16f-yellow);
  color: var(--sgv16f-text);
  background-image: none;
}

body.brand-v16-forum .posting-footer .options li span.small {
  font-size: inherit;
}
