:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-primary: #1f5fd0;
  --color-text: #222;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  /* Explicit width prevents inline-size-contained plugin content from giving
     auto-margined flex children a zero intrinsic width (classic layout). */
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  overflow: auto; /* Clearfix, damit floatende Bilder in Fließtext-Bereichen den Container nicht sprengen */
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.site-header-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
}

.account-nav {
  position: absolute;
  top: 0.75rem;
  right: 1.5rem;
  z-index: 60;
  max-width: min(80vw, 420px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 3px 12px rgb(0 0 0 / 8%);
}

.account-nav .nav-list { justify-content: flex-end; }
.account-nav .nav-children { right: 0; left: auto; }
.site-header:has(.account-nav:not([hidden])) .header-inner { padding-right: 180px; }

@media (max-width: 600px) {
  .account-nav { position: relative; top: auto; right: auto; margin: 0 1rem 0.75rem auto; width: fit-content; }
  .site-header:has(.account-nav:not([hidden])) .header-inner { padding-right: 0; }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo {
  height: 40px;
  width: auto;
}

.site-header h1 {
  font-size: 1.4rem;
  margin: 0;
}

main {
  flex: 1;
  padding: 2rem 0;
}

.hero {
  padding: 2rem 0;
  text-align: center;
}

.hero p {
  color: var(--color-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
  overflow: auto; /* Clearfix, damit floatende Bilder im Vorstellungstext den Container nicht sprengen */
  text-align: left;
}

#not-configured {
  text-align: center;
  color: var(--color-muted);
}

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  /* Erzwingt exakt die Maße Ihres funktionierenden Haupt-Containers */
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box; /* Wichtig, damit das Padding die 960px nicht verfälscht */
    overflow: visible; /* Überschreibt das 'overflow: auto' des normalen Containers */
  
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links a { color: var(--color-primary); }
.website-plain-text { white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
#legal-modal-body { text-align: left; line-height: 1.6; }
#legal-modal-body img { max-width: 100%; height: auto; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
.ql-size-small { font-size: .75em; }
.ql-size-large { font-size: 1.5em; }
.ql-size-huge { font-size: 2.5em; }
.ql-font-serif { font-family: Georgia, serif; }
.ql-font-monospace { font-family: monospace; }

.footer-links button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-primary);
  cursor: pointer;
  text-decoration: underline;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-muted);
}

#injected-content form,
#injected-content-klassisch form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
}

#injected-content label,
#injected-content-klassisch label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

/* Generischer Inline-Contentbereich, in den vom Modul injizierte Menüpunkte
   (z.B. Login, Account) ihre Inhalte rendern - kein Popup mehr. */
#injected-content,
#injected-content-klassisch {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}

/* Hierarchische, vom Modul injizierte Menüpunkte innerhalb der bestehenden Navs.
   "order" erzwingt die Position ganz unten/hinten, unabhängig davon, ob die
   Menü-Hooks oder die Portal-Seiten zuerst asynchron geladen wurden. */
.injected-menu-group {
  display: flex;
  gap: 1.25rem;
  order: 100;
}

.klassisch-nav .injected-menu-group,
.klassisch-nav .injected-menu-group .injected-menu-group {
  flex-direction: column;
  gap: 0.25rem;
}

.klassisch-nav .injected-menu-group .injected-menu-group {
  padding-left: 1rem;
}

.modern-nav .injected-menu-group .injected-menu-group {
  flex-direction: column;
  position: absolute;
  margin-top: 1.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5rem;
  gap: 0.25rem;
}

.injected-menu-item {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.injected-menu-item:hover {
  text-decoration: underline;
}

.injected-menu-item.active {
  text-decoration: underline;
}

.klassisch-nav .injected-menu-item.active {
  background: var(--color-bg);
  border-radius: 6px;
}

.consent-checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
}

.danger-button {
  margin-top: 0.75rem;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* ==========================================
   MODERN-LAYOUT: Menüband oben, alle Subsites untereinander
   ========================================== */
.modern-nav {
  padding: 0.5rem 1.5rem 0.75rem;
  overflow: visible;
}

.modern-nav a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.modern-nav a:hover {
  text-decoration: underline;
}

.modern-nav a.nav-home {
  font-weight: 700;
  color: var(--color-text);
}

#layout-modern {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.modern-banner {
  position: relative;
  min-height: 140px;
  overflow: hidden;
  background: var(--color-primary);
  padding: 1rem 1.5rem;
}

.modern-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modern-banner h1 {
  position: relative;
  color: #fff;
}

.modern-banner img[hidden],
.klassisch-banner img[hidden] {
  display: none;
}

.nav-list,
.nav-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-node {
  position: relative;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-row .nav-link {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  overflow-wrap: anywhere;
}

.nav-toggle {
  flex-shrink: 0;
  border: 0;
  border-radius: 4px;
  padding: 0.5rem;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}

.nav-link:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.modern-nav .nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.modern-nav .nav-children {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: min(16rem, calc(100vw - 3rem));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 4px 12px #0002;
  z-index: 1;
}

.modern-nav .nav-node.is-open > .nav-children {
  display: block;
}

.modern-nav .nav-children .nav-children {
  top: 0;
  left: 100%;
}

.modern-nav .nav-list > .nav-node:last-child > .nav-children {
  left: auto;
  right: 0;
}

.klassisch-nav .nav-children {
  margin-left: 1rem;
}

#hero,
#modern-pages .page-section {
  scroll-margin-top: calc(var(--modern-header-height, 210px) + 12px);
}

@media (max-width: 640px) {
  .modern-nav .nav-children .nav-children {
    position: static;
    width: auto;
    margin-left: 0.75rem;
    box-shadow: none;
  }
}

.page-section {
  padding: 2rem 0;
  overflow: auto; /* Clearfix, damit der Container um floatende Bilder herum nicht kollabiert */
}

.page-section h2 {
  margin-top: 0;
}

/* ==========================================
   KLASSISCH-LAYOUT: Menü links, Subsites als Einzelseiten
   ========================================== */
:root {
  --klassisch-header-height: 140px;
  --klassisch-sidebar-width: 260px;
  --klassisch-title-color: #ffffff;
}

.klassisch-layout {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
  padding-top: var(--klassisch-header-height);
}

#layout-modern[hidden],
#layout-klassisch[hidden],
.nav-children[hidden] {
  display: none;
}

/* Fixer Kopfbereich über der gesamten Seite: scrollt nicht mit.
   Links das Logo (Breite = Sidebar-Breite), rechts daneben das Banner mit Titel. */
.klassisch-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--klassisch-header-height);
  z-index: 60;
  display: flex;
  align-items: stretch;
}

.klassisch-site-footer {
    position: fixed;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1.25rem 0;
    bottom: 0;
    width: calc(100% - var(--klassisch-sidebar-width));
}

.klassisch-header-logo {
  width: var(--klassisch-sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.klassisch-banner {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.klassisch-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}

.klassisch-banner h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--klassisch-title-color);
  font-size: 1.6rem;
}

.klassisch-sidebar {
  position: fixed;
  top: var(--klassisch-header-height);
  left: 0;
  bottom: 0;
  width: var(--klassisch-sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  z-index: 55;
}

.site-logo-klassisch {
  height: 96px;
  width: auto;
  max-width: 100%;
}

.klassisch-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.klassisch-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
}

.klassisch-nav a:hover,
.klassisch-nav a.active {
  background: var(--color-bg);
  color: var(--color-primary);
}

.klassisch-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--klassisch-sidebar-width);
  padding-bottom: var(--klassisch-footer-height, 100px);
}

/* Generisches Tabellen-Widget (GRID-Direktive im UI-Interpreter) */
.dynamic-grid {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 20px;
}

.dynamic-grid th,
.dynamic-grid td {
  border: 1px solid var(--color-border, #ccc);
  padding: 6px 10px;
  text-align: left;
}

.dynamic-grid-row {
  cursor: pointer;
}

.dynamic-grid-row:hover {
  background: var(--color-bg-hover, #f0f0f0);
}

/* FX-Entwurfsbausteine: bewusst nur in den beiden Website-Layouts aktiv. */
#layout-modern .fx-draft-list,
#layout-klassisch .fx-draft-list {
  max-width: 100%;
  margin: 1rem 0;
  padding-inline-start: 1.5rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#layout-modern .fx-draft-list-item,
#layout-klassisch .fx-draft-list-item {
  min-width: 0;
  margin-block: 0.4rem;
  overflow-wrap: anywhere;
}

#layout-modern [data-fx-draft-type="image"],
#layout-klassisch [data-fx-draft-type="image"] {
  max-width: 100%;
  margin: 1rem 0;
}

#layout-modern [data-fx-draft-type="image"] img,
#layout-klassisch [data-fx-draft-type="image"] img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

#layout-modern .fx-draft-flip-card,
#layout-klassisch .fx-draft-flip-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  perspective: 1000px;
  transform-style: preserve-3d;
  max-width: 100%;
  color: var(--color-text, #222);
}

#layout-modern .fx-draft-flip-card [data-fx-card-face],
#layout-klassisch .fx-draft-flip-card [data-fx-card-face] {
  grid-area: 1 / 1;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: var(--color-surface, #fff);
  color: inherit;
  line-height: 1.5;
  backface-visibility: hidden;
  overflow-wrap: anywhere;
  transition: transform var(--fx-card-duration, 600ms) ease;
}

#layout-modern .fx-draft-flip-card [data-fx-card-face] > :first-child,
#layout-klassisch .fx-draft-flip-card [data-fx-card-face] > :first-child {
  margin-top: 0;
}

#layout-modern .fx-draft-flip-card [data-fx-card-face] > :last-child,
#layout-klassisch .fx-draft-flip-card [data-fx-card-face] > :last-child {
  margin-bottom: 0;
}

#layout-modern .fx-draft-flip-card[data-fx-card-direction="horizontal"] [data-fx-card-face="back"],
#layout-klassisch .fx-draft-flip-card[data-fx-card-direction="horizontal"] [data-fx-card-face="back"] {
  transform: rotateY(180deg);
}

#layout-modern .fx-draft-flip-card[data-fx-card-direction="horizontal"][data-fx-card-flipped="true"] [data-fx-card-face="front"],
#layout-klassisch .fx-draft-flip-card[data-fx-card-direction="horizontal"][data-fx-card-flipped="true"] [data-fx-card-face="front"] {
  transform: rotateY(-180deg);
}

#layout-modern .fx-draft-flip-card[data-fx-card-direction="horizontal"][data-fx-card-flipped="true"] [data-fx-card-face="back"],
#layout-klassisch .fx-draft-flip-card[data-fx-card-direction="horizontal"][data-fx-card-flipped="true"] [data-fx-card-face="back"] {
  transform: rotateY(0deg);
}

#layout-modern .fx-draft-flip-card[data-fx-card-direction="vertical"] [data-fx-card-face="back"],
#layout-klassisch .fx-draft-flip-card[data-fx-card-direction="vertical"] [data-fx-card-face="back"] {
  transform: rotateX(180deg);
}

#layout-modern .fx-draft-flip-card[data-fx-card-direction="vertical"][data-fx-card-flipped="true"] [data-fx-card-face="front"],
#layout-klassisch .fx-draft-flip-card[data-fx-card-direction="vertical"][data-fx-card-flipped="true"] [data-fx-card-face="front"] {
  transform: rotateX(-180deg);
}

#layout-modern .fx-draft-flip-card[data-fx-card-direction="vertical"][data-fx-card-flipped="true"] [data-fx-card-face="back"],
#layout-klassisch .fx-draft-flip-card[data-fx-card-direction="vertical"][data-fx-card-flipped="true"] [data-fx-card-face="back"] {
  transform: rotateX(0deg);
}

#layout-modern .fx-draft-flip-card [data-fx-card-toggle],
#layout-klassisch .fx-draft-flip-card [data-fx-card-toggle] {
  grid-column: 1;
  justify-self: start;
  min-height: 2.75rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-primary, #1f5fd0);
  border-radius: 6px;
  background: var(--color-surface, #fff);
  color: var(--color-primary, #1f5fd0);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

#layout-modern .fx-draft-flip-card [data-fx-card-toggle]:focus-visible,
#layout-klassisch .fx-draft-flip-card [data-fx-card-toggle]:focus-visible {
  outline: 3px solid var(--color-primary, #1f5fd0);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  #layout-modern .fx-draft-flip-card [data-fx-card-toggle]:hover,
  #layout-klassisch .fx-draft-flip-card [data-fx-card-toggle]:hover {
    background: var(--color-primary, #1f5fd0);
    color: #fff;
  }
}

#layout-modern .fx-draft-columns,
#layout-klassisch .fx-draft-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem;
  max-width: 100%;
}

#layout-modern .fx-draft-quote,
#layout-klassisch .fx-draft-quote {
  margin-inline: 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--color-border, #e5e7eb);
  color: var(--color-text, #222);
}

#layout-modern .fx-draft-quote[data-fx-variant="accent"],
#layout-klassisch .fx-draft-quote[data-fx-variant="accent"] {
  border-left-color: var(--color-primary, #1f5fd0);
  background: var(--color-bg, #f7f8fa);
}

#layout-modern .fx-draft-quote[data-fx-variant="centered"],
#layout-klassisch .fx-draft-quote[data-fx-variant="centered"] {
  border-left: 0;
  border-top: 3px solid var(--color-primary, #1f5fd0);
  text-align: center;
}

#layout-modern .fx-draft-action,
#layout-klassisch .fx-draft-action {
  padding: 1.5rem;
  border: 1px solid #1f5fd0;
  border-radius: 8px;
  background: #1f5fd0;
  color: #fff;
  text-align: center;
}

#layout-modern .fx-draft-notice,
#layout-klassisch .fx-draft-notice {
  max-width: 100%;
  margin-inline: 0;
  padding: 1rem 1.25rem;
  border: 1px solid #bfdbfe;
  border-left-width: 5px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#layout-modern .fx-draft-notice > :first-child,
#layout-klassisch .fx-draft-notice > :first-child { margin-top: 0; }

#layout-modern .fx-draft-notice > :last-child,
#layout-klassisch .fx-draft-notice > :last-child { margin-bottom: 0; }

#layout-modern .fx-draft-notice[data-fx-variant="success"],
#layout-klassisch .fx-draft-notice[data-fx-variant="success"] {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}

#layout-modern .fx-draft-notice[data-fx-variant="warning"],
#layout-klassisch .fx-draft-notice[data-fx-variant="warning"] {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #78350f;
}

#layout-modern .fx-draft-notice[data-fx-variant="error"],
#layout-klassisch .fx-draft-notice[data-fx-variant="error"] {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #7f1d1d;
}

#layout-modern .fx-draft-action[data-fx-variant="soft"],
#layout-klassisch .fx-draft-action[data-fx-variant="soft"] {
  border-color: var(--color-border, #e5e7eb);
  background: var(--color-bg, #f7f8fa);
  color: var(--color-text, #222);
}

#layout-modern .fx-draft-action[data-fx-variant="outline"],
#layout-klassisch .fx-draft-action[data-fx-variant="outline"] {
  background: var(--color-surface, #fff);
  color: var(--color-text, #222);
}

#layout-modern .fx-draft-action-link,
#layout-klassisch .fx-draft-action-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border: 2px solid currentColor;
  border-radius: 6px;
  color: inherit;
  font-weight: 600;
  overflow-wrap: anywhere;
}

#layout-modern .fx-draft-action-link:focus-visible,
#layout-klassisch .fx-draft-action-link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

#layout-modern .fx-draft-quote[data-fx-spacing="compact"],
#layout-klassisch .fx-draft-quote[data-fx-spacing="compact"],
#layout-modern .fx-draft-action[data-fx-spacing="compact"],
#layout-klassisch .fx-draft-action[data-fx-spacing="compact"],
#layout-modern .fx-draft-columns[data-fx-spacing="compact"],
#layout-klassisch .fx-draft-columns[data-fx-spacing="compact"],
#layout-modern .fx-draft-notice[data-fx-spacing="compact"],
#layout-klassisch .fx-draft-notice[data-fx-spacing="compact"] { margin-block: 0.5rem; }
#layout-modern .fx-draft-quote[data-fx-spacing="normal"],
#layout-klassisch .fx-draft-quote[data-fx-spacing="normal"],
#layout-modern .fx-draft-action[data-fx-spacing="normal"],
#layout-klassisch .fx-draft-action[data-fx-spacing="normal"],
#layout-modern .fx-draft-columns[data-fx-spacing="normal"],
#layout-klassisch .fx-draft-columns[data-fx-spacing="normal"],
#layout-modern .fx-draft-notice[data-fx-spacing="normal"],
#layout-klassisch .fx-draft-notice[data-fx-spacing="normal"] { margin-block: 1rem; }
#layout-modern .fx-draft-quote[data-fx-spacing="relaxed"],
#layout-klassisch .fx-draft-quote[data-fx-spacing="relaxed"],
#layout-modern .fx-draft-action[data-fx-spacing="relaxed"],
#layout-klassisch .fx-draft-action[data-fx-spacing="relaxed"],
#layout-modern .fx-draft-columns[data-fx-spacing="relaxed"],
#layout-klassisch .fx-draft-columns[data-fx-spacing="relaxed"],
#layout-modern .fx-draft-notice[data-fx-spacing="relaxed"],
#layout-klassisch .fx-draft-notice[data-fx-spacing="relaxed"] { margin-block: 2rem; }

#layout-modern .fx-draft-columns[data-fx-variant="wide"],
#layout-klassisch .fx-draft-columns[data-fx-variant="wide"] { gap: 2rem; }

#layout-modern .fx-draft-column,
#layout-klassisch .fx-draft-column {
  min-width: 0;
  overflow-wrap: anywhere;
}

#layout-modern .fx-draft-link-button,
#layout-klassisch .fx-draft-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

@media (hover: hover) and (pointer: fine) {
  #layout-modern .fx-draft-link-button:hover,
  #layout-klassisch .fx-draft-link-button:hover {
    filter: brightness(0.92);
  }
}

#layout-modern .fx-draft-button,
#layout-klassisch .fx-draft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

#layout-modern .fx-draft-button[data-fx-button-variant="primary"],
#layout-klassisch .fx-draft-button[data-fx-button-variant="primary"] {
  background: var(--color-primary);
  color: #fff;
}

#layout-modern .fx-draft-button[data-fx-button-variant="secondary"],
#layout-klassisch .fx-draft-button[data-fx-button-variant="secondary"] {
  background: var(--color-surface, #fff);
  color: var(--color-text, #222);
}

#layout-modern .fx-draft-button[data-fx-button-variant="outline"],
#layout-klassisch .fx-draft-button[data-fx-button-variant="outline"] {
  background: transparent;
  color: var(--color-primary);
}

#layout-modern .fx-draft-button:focus-visible,
#layout-klassisch .fx-draft-button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  #layout-modern .fx-draft-button:hover,
  #layout-klassisch .fx-draft-button:hover {
    filter: brightness(0.92);
  }
}

@media (max-width: 600px) {
  #layout-modern .fx-draft-columns,
  #layout-klassisch .fx-draft-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  #layout-modern [data-fx-draft-type="image"],
  #layout-klassisch [data-fx-draft-type="image"] {
    width: 100%;
  }

  #layout-modern .fx-draft-list,
  #layout-klassisch .fx-draft-list {
    padding-inline-start: 1.25rem;
  }

  #layout-modern .fx-draft-flip-card [data-fx-card-face],
  #layout-klassisch .fx-draft-flip-card [data-fx-card-face] {
    padding: 0.875rem;
  }

  #layout-modern .fx-draft-columns[data-fx-variant="wide"],
  #layout-klassisch .fx-draft-columns[data-fx-variant="wide"] {
    gap: 1rem;
  }

  #layout-modern .fx-draft-action,
  #layout-klassisch .fx-draft-action {
    padding: 1rem;
  }

  #layout-modern .fx-draft-notice,
  #layout-klassisch .fx-draft-notice {
    padding: 0.875rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #layout-modern .fx-draft-flip-card,
  #layout-klassisch .fx-draft-flip-card {
    perspective: none;
    transform-style: flat;
  }

  #layout-modern .fx-draft-flip-card [data-fx-card-face],
  #layout-klassisch .fx-draft-flip-card [data-fx-card-face],
  #layout-modern .fx-draft-flip-card[data-fx-card-direction][data-fx-card-flipped] [data-fx-card-face],
  #layout-klassisch .fx-draft-flip-card[data-fx-card-direction][data-fx-card-flipped] [data-fx-card-face] {
    backface-visibility: visible;
    transition: none;
    transform: none;
  }

  #layout-modern .fx-draft-flip-card [data-fx-card-face="back"],
  #layout-klassisch .fx-draft-flip-card [data-fx-card-face="back"] {
    display: none;
  }

  #layout-modern .fx-draft-flip-card[data-fx-card-flipped="true"] [data-fx-card-face="front"],
  #layout-klassisch .fx-draft-flip-card[data-fx-card-flipped="true"] [data-fx-card-face="front"] {
    display: none;
  }

  #layout-modern .fx-draft-flip-card[data-fx-card-flipped="true"] [data-fx-card-face="back"],
  #layout-klassisch .fx-draft-flip-card[data-fx-card-flipped="true"] [data-fx-card-face="back"] {
    display: block;
  }
}

/* Effekte bleiben auf explizit markierte FX-Vorschau-Elemente in den Website-Layouts beschränkt.
   Separate Animationsnamen lassen Scroll- und Übergangspresets gleichzeitig wirken. */
#layout-modern .fx-effect-scroll-smooth,
#layout-modern .fx-effect-transition-fade,
#layout-modern .fx-effect-transition-reveal,
#layout-klassisch .fx-effect-scroll-smooth,
#layout-klassisch .fx-effect-transition-fade,
#layout-klassisch .fx-effect-transition-reveal {
  animation-name: var(--fx-scroll-animation, none), var(--fx-transition-animation, none);
  animation-duration: var(--fx-effect-duration, 420ms), var(--fx-effect-duration, 420ms);
  animation-timing-function: ease-out, ease-out;
  animation-fill-mode: both, both;
}

#layout-modern .fx-effect-scroll-smooth,
#layout-klassisch .fx-effect-scroll-smooth {
  --fx-scroll-animation: fx-preview-scroll-reveal;
}

#layout-modern .fx-effect-scroll-parallax,
#layout-klassisch .fx-effect-scroll-parallax {
  translate: 0 var(--fx-parallax-offset, 0px);
  will-change: translate;
}

@keyframes fx-preview-scroll-reveal {
  from { translate: 0 var(--fx-effect-distance, 8px); }
  to { translate: 0 0; }
}

#layout-modern .fx-effect-transition-fade,
#layout-klassisch .fx-effect-transition-fade {
  --fx-transition-animation: fx-preview-fade-in;
}

#layout-modern .fx-effect-transition-reveal,
#layout-klassisch .fx-effect-transition-reveal {
  --fx-transition-animation: fx-preview-section-reveal;
}

@keyframes fx-preview-fade-in {
  from { opacity: var(--fx-effect-start-opacity, 0.82); }
  to { opacity: 1; }
}

@keyframes fx-preview-section-reveal {
  from {
    opacity: var(--fx-effect-start-opacity, 0.82);
    transform: translateY(var(--fx-effect-distance, 8px));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#layout-modern .fx-effect-background-gradient,
#layout-klassisch .fx-effect-background-gradient {
  background-image: linear-gradient(
    135deg,
    var(--fx-effect-background-start, rgba(31, 95, 208, 0.035)),
    var(--fx-effect-background-end, rgba(31, 95, 208, 0.10))
  );
}

#layout-modern .fx-effect-background-fixed,
#layout-klassisch .fx-effect-background-fixed {
  background-attachment: fixed;
}

@media (hover: hover) and (pointer: fine) {
  #layout-modern a.fx-effect-hover-lift:hover,
  #layout-modern article.fx-effect-hover-lift:hover,
  #layout-modern .fx-draft-flip-card.fx-effect-hover-lift:hover,
  #layout-klassisch a.fx-effect-hover-lift:hover,
  #layout-klassisch article.fx-effect-hover-lift:hover,
  #layout-klassisch .fx-draft-flip-card.fx-effect-hover-lift:hover {
    transform: translateY(calc(-1 * var(--fx-effect-distance, 4px)));
    transition: transform var(--fx-effect-duration, 220ms) ease;
  }

  #layout-modern a.fx-effect-hover-grow:hover,
  #layout-modern article.fx-effect-hover-grow:hover,
  #layout-modern .fx-draft-flip-card.fx-effect-hover-grow:hover,
  #layout-klassisch a.fx-effect-hover-grow:hover,
  #layout-klassisch article.fx-effect-hover-grow:hover,
  #layout-klassisch .fx-draft-flip-card.fx-effect-hover-grow:hover {
    transform: scale(var(--fx-effect-scale, 1.02));
    transition: transform var(--fx-effect-duration, 220ms) ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  #layout-modern .fx-effect-scroll-smooth:not(.fx-draft-flip-card),
  #layout-modern .fx-effect-scroll-parallax:not(.fx-draft-flip-card),
  #layout-modern .fx-effect-transition-fade:not(.fx-draft-flip-card),
  #layout-modern .fx-effect-transition-reveal:not(.fx-draft-flip-card),
  #layout-modern .fx-effect-hover-lift:not(.fx-draft-flip-card),
  #layout-modern .fx-effect-hover-grow:not(.fx-draft-flip-card),
  #layout-modern .fx-effect-hover-lift a,
  #layout-modern .fx-effect-hover-grow a,
  #layout-klassisch .fx-effect-scroll-smooth:not(.fx-draft-flip-card),
  #layout-klassisch .fx-effect-scroll-parallax:not(.fx-draft-flip-card),
  #layout-klassisch .fx-effect-transition-fade:not(.fx-draft-flip-card),
  #layout-klassisch .fx-effect-transition-reveal:not(.fx-draft-flip-card),
  #layout-klassisch .fx-effect-hover-lift:not(.fx-draft-flip-card),
  #layout-klassisch .fx-effect-hover-grow:not(.fx-draft-flip-card),
  #layout-klassisch .fx-effect-hover-lift a,
  #layout-klassisch .fx-effect-hover-grow a {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    translate: none !important;
  }

  #layout-modern .fx-effect-hover-lift.fx-draft-flip-card,
  #layout-modern .fx-effect-hover-grow.fx-draft-flip-card,
  #layout-modern .fx-effect-hover-lift .fx-draft-flip-card,
  #layout-modern .fx-effect-hover-grow .fx-draft-flip-card,
  #layout-klassisch .fx-effect-hover-lift.fx-draft-flip-card,
  #layout-klassisch .fx-effect-hover-grow.fx-draft-flip-card,
  #layout-klassisch .fx-effect-hover-lift .fx-draft-flip-card,
  #layout-klassisch .fx-effect-hover-grow .fx-draft-flip-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  #layout-modern .fx-effect-background-fixed,
  #layout-klassisch .fx-effect-background-fixed {
    background-attachment: scroll;
  }
}

#layout-modern.fx-preview-reduced-motion .fx-effect-scroll-smooth:not(.fx-draft-flip-card),
#layout-modern.fx-preview-reduced-motion .fx-effect-scroll-parallax:not(.fx-draft-flip-card),
#layout-modern.fx-preview-reduced-motion .fx-effect-transition-fade:not(.fx-draft-flip-card),
#layout-modern.fx-preview-reduced-motion .fx-effect-transition-reveal:not(.fx-draft-flip-card),
#layout-modern.fx-preview-reduced-motion .fx-effect-hover-lift:not(.fx-draft-flip-card),
#layout-modern.fx-preview-reduced-motion .fx-effect-hover-grow:not(.fx-draft-flip-card),
#layout-modern.fx-preview-reduced-motion .fx-effect-hover-lift a,
#layout-modern.fx-preview-reduced-motion .fx-effect-hover-grow a,
#layout-klassisch.fx-preview-reduced-motion .fx-effect-scroll-smooth:not(.fx-draft-flip-card),
#layout-klassisch.fx-preview-reduced-motion .fx-effect-scroll-parallax:not(.fx-draft-flip-card),
#layout-klassisch.fx-preview-reduced-motion .fx-effect-transition-fade:not(.fx-draft-flip-card),
#layout-klassisch.fx-preview-reduced-motion .fx-effect-transition-reveal:not(.fx-draft-flip-card),
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-lift:not(.fx-draft-flip-card),
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-grow:not(.fx-draft-flip-card),
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-lift a,
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-grow a {
  animation: none !important;
  transition: none !important;
  transform: none !important;
  translate: none !important;
}

#layout-modern.fx-preview-reduced-motion .fx-effect-hover-lift.fx-draft-flip-card,
#layout-modern.fx-preview-reduced-motion .fx-effect-hover-grow.fx-draft-flip-card,
#layout-modern.fx-preview-reduced-motion .fx-effect-hover-lift .fx-draft-flip-card,
#layout-modern.fx-preview-reduced-motion .fx-effect-hover-grow .fx-draft-flip-card,
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-lift.fx-draft-flip-card,
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-grow.fx-draft-flip-card,
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-lift .fx-draft-flip-card,
#layout-klassisch.fx-preview-reduced-motion .fx-effect-hover-grow .fx-draft-flip-card {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

#layout-modern.fx-preview-reduced-motion .fx-effect-background-fixed,
#layout-klassisch.fx-preview-reduced-motion .fx-effect-background-fixed {
  background-attachment: scroll;
}

.module-message-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; margin: 14px 0; overflow-wrap: anywhere; }
.module-message-card p { margin: 10px 0; line-height: 1.6; }
.module-message-card small { color: #64748b; }
