body.light-mode #haui-demo-container,
body.light-mode #haui-demo-container p,
body.light-mode #haui-demo-container h1,
body.light-mode #haui-demo-container span,
body.light-mode #haui-demo-container div,
body.light-mode #haui-demo-container small,
body.light-mode #haui-demo-container strong {
  color: #f0eee9 !important;
}
body.light-mode #haui-demo-container {
  background-color: #2f3336 !important;
}
.haui-wrapper {
  --haui-dark: #2f3336;
  --haui-offwhite: #f0eee9;
  --haui-accent: #5a6863;
  position: relative;
  width: 100%;
  background-color: var(--haui-dark);
  color: var(--haui-offwhite);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  margin-top: 4rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--haui-accent);
}
.haui-wrapper * {
  box-sizing: border-box;
  transition: all 0.5s ease;
  margin: 0;
  padding: 0;
}
.haui-wrapper p {
  margin-bottom: 1.2rem;
}

/* HEADER */

.haui-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 3rem;
  z-index: 10;
  position: relative;
}
.haui-brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.haui-logo-box {
  width: 24px;
  height: 24px;
  background: var(--haui-offwhite);
  border-radius: 3px;
}
.haui-mini-nav {
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  gap: 1.5rem;
  opacity: 0.7;
}
.haui-active {
  border-bottom: 1px solid var(--haui-offwhite);
  padding-bottom: 2px;
}
.haui-toggle-zone {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.haui-toggle-labels {
  text-align: right;
  line-height: 1.3;
}
.haui-toggle-labels small {
  font-size: 1rem;
  text-transform: uppercase;
  display: block;
  letter-spacing: 0.5px;
  color: #9BCCB1;
}
.haui-toggle-labels span {
  font-size: 0.85rem;
  font-weight: 600;
}

/* SCHALTER */

.haui-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: block;
}
.haui-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.haui-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid #9BCCB1;
  border-radius: 24px;
}
.haui-slider:before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #9BCCB1;
  border-radius: 50%;
}
#haui-demo-container input:checked + .haui-slider:before {
  transform: translateX(20px);
  background: var(--haui-offwhite);
}
#haui-demo-container input:checked + .haui-slider {
  border-color: var(--haui-offwhite);
}

/* MAIN CONTENT */

.haui-main {
  display: flex;
  flex: 1;
  padding: 2rem 3rem 2rem 3rem;
  gap: 4rem;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}
.haui-sidebar {
  width: 140px;
  flex-shrink: 0;
  font-size: 0.8rem;
  opacity: 0.8;
}
.haui-avatar {
  width: 50px;
  height: 50px;
  background: var(--haui-accent);
  border-radius: 4px;
  margin-bottom: 1rem;
}
.haui-social-row {
  display: flex;
  gap: 1rem;
  opacity: 0.6;
  margin-top: 1.5rem;
  font-weight: bold;
}
.haui-kicker {
  font-size: 0.8rem;
  opacity: 0.6;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}
.haui-headline {
  font-family: "Playfair Display", serif;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
  line-height: 1.1;
}
.haui-text-content {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.85;
}
.haui-separator {
  padding: 0.75rem 0;
  border-top: 1px solid #fff;
  opacity: 0.5;
}

/* GEOMETRISCHE FORMEN */

.haui-geom-bg {
  position: absolute;
  color: rgba(240, 238, 233, 0.8);
  pointer-events: none;
  z-index: 0;
  width: 250px;
}
.haui-geom-bg svg {
  width: 100%;
  height: auto;
}
.haui-geom-right {
  top: 80px;
  right: -20px;
}

/* FOKUS MODUS LOGIK (Aktivierung) */

.haui-focus-mode .haui-deco {
  opacity: 0 !important;
  visibility: hidden;
  transform: translateY(15px);
}
.haui-focus-mode .haui-main {
  justify-content: center;
}
.haui-focus-mode .haui-sidebar {
  width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.haui-focus-mode .haui-article {
  margin-top: 1rem;
}
.haui-focus-mode .haui-headline {
  font-size: 2.8rem;
  letter-spacing: -0.5px;
  margin-bottom: 2rem;
}
.haui-focus-mode .haui-text-content {
  font-size: 1.2rem;
  line-height: 1.9;
  opacity: 1;
}
.haui-focus-mode .haui-wrapper p {
  margin-bottom: 1.8rem;
}

/* Mobile Optimierung */
/* Finaler Mobile-Stacking-Fix für das HAUI-Widget */
@media (max-width: 600px) {
    /* 1. Den Haupt-Container auf reines Block-Verhalten zwingen */
    .haui-main {
        display: block !important; /* Deaktiviert Flexbox komplett für die Stapelung */
        width: 100% !important;
    }

    /* 2. Sidebar (Profil) als saubere, abgeschlossene obere Zeile */
    .haui-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 0 0 1.5rem 0 !important;
        margin-bottom: 2rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        float: none !important; /* Entfernt eventuelle Floats */
    }

    .haui-avatar {
        width: 48px !important;
        height: 48px !important;
        flex-shrink: 0;
        margin: 0 !important;
    }

    .haui-sidebar p {
        margin: 0 0 0 1rem !important;
        text-align: left !important;
        font-size: 0.9rem !important;
    }

    .haui-social-row {
        margin-left: auto !important;
        margin-top: 0 !important;
    }

    /* 3. Artikel-Bereich: Darf erst NACH dem Profil beginnen */
    .haui-article {
        width: 100% !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        clear: both !important; /* Zwingt den Text unter die Sidebar-Elemente */
    }

    .haui-headline {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        margin: 0.5rem 0 1rem 0 !important;
    }

    /* 4. Header-Anpassung: Live-Test Zone zentrieren */
    .haui-header {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .haui-toggle-zone {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0.75rem 1rem !important;
        border-radius: 12px;
        box-sizing: border-box;
    }
}