:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --border: #e2e8f0;
  --accent: #6D579F;
  --accent-2: #8b6fe0;
  --radius: 16px;
}

/* Global */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu,
    Cantarell, 'Noto Sans', 'Helvetica Neue', Arial;
  color: var(--text);
  background: var(--bg);
}

/* Layout / Basics */

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0px 20px 32px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent));
}




/* Panels / Sections */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.subtle {
  color: #475569;
  font-size: 13px;
}

/* Haupt-Breadcrumbs */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
  padding: 8px 0 6px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.crumb .idx {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  background: #e2e8f0;
}

.crumb[aria-current='step'] {
  background: white !important;
  /* background: linear-gradient(90deg, rgba(125, 100, 200, 0.12), rgba(109, 87, 159, 0.18)); */
  border-color: var(--accent-2);
}

.crumb[aria-current='step'] .idx {
  background: var(--accent-2);
  color: #fff;
}

/* erledigte Sektionen (Häkchen) */
.crumb.crumb--done {
  background: #f1f5ff;
  border-color: var(--accent-2);
}

.crumb.crumb--done .idx {
  background: var(--accent-2);
  color: #fff;
}

/* unvollständige Sektionen (Warnsymbol) */
.crumb.crumb--warn {
  background: #fff7ed;
  border-color: #f97316;
}

.crumb.crumb--warn .idx {
  background: #f97316;
  color: #fff;
}


/* === Haupt-Breadcrumbs vollbreit + größer + gepunktete Linie === */

.breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;                     /* etwas Abstand zwischen Steps */
  margin: 20px 0 24px;
  padding: 8px 0 10px;
  position: relative;
}

/* Gepunktete Linie unter den Steps */
.breadcrumbs::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px dotted var(--border);
  z-index: 0;
}

/* Steps füllen die gesamte Breite gleichmäßig aus */
.crumb {
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
  font-size: 14px;               /* größere Schrift */
  padding: 10px 18px;
  position: relative;
  z-index: 1;                    /* über der gepunkteten Linie */
}

/* größere Kreise mit Ziffern */
.crumb .idx {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

/* Aktiver Step bleibt optisch hervorgehoben */
.crumb[aria-current='step'] {
  background: linear-gradient(90deg, rgba(125, 100, 200, 0.16), rgba(109, 87, 159, 0.28));
  border-color: var(--accent-2);
}

/* erledigte Steps: behalten ihren "aktiven" Look, aber mit Häkchen */
.crumb.crumb--done {
  background: #f1f5ff;
  border-color: var(--accent-2);
  opacity: 0.95;
}

.crumb.crumb--done .idx {
  background: var(--accent-2);
  color: #fff;
}

/* Story-Breadcrumbs */

.story-bc {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 6px;
}

.story-step {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  text-transform: capitalize;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.story-step[aria-current='step'] {
  background: white !important;
  /* background: rgba(109, 87, 159, 0.12);*/
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(139, 111, 224, 0.4);
}

.story-bc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  position: relative;
}

/* Gepunktete Linie auch hier */
.story-bc::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px dotted var(--border);
  z-index: 0;
}

.story-step {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 14px;         /* etwas größer */
  padding: 8px 14px;
  position: relative;
  z-index: 1;
}

/* aktive Story-Steps bleiben wie definiert, bekommen aber etwas mehr "Punch" */
.story-step[aria-current='step'] {
  background: rgba(109, 87, 159, 0.16);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(139, 111, 224, 0.5);
}


/* Carousel / Charakterkarten */

.carousel-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.carousel-viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  padding: 0;
}

.carousel {
  display: flex;
  gap: 16px;
  padding: 12px 12px 16px;
  scroll-behavior: smooth;
}

.card {
  min-width: 100%;
  flex: 0 0 100%;
  position: relative;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 8px 4px 0;
  border-radius: 18px;
}

.carousel .card {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.carousel .card.is-removing {
  opacity: 0;
  transform: translateX(-12px);
}

.card .badge {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60px;
  margin-bottom: 5px;
  font-size: 16px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.card h3 {
  margin-top: 4px;
  margin-bottom: 16px;
  font-size: 16px;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.carousel-nav.is-hidden {
  visibility: hidden;
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
}

/* Form / Inputs */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  font-size: 14px;
  color: #334155;
  display: block;
  margin-bottom: 6px;
}

input[type='text'],
input[type='number'],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  outline: none;
}

/* Swatches & Icon-Radios */

.swatches,
.image-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid var(--border);
  cursor: pointer;
}

.swatch.is-selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(139, 111, 224, 0.35);
}

.radio-img {
  width: 80px;
  min-height: 80px;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  background: white;
  cursor: pointer;
  font-size: 12px;
}

.radio-img-icon {
  font-size: 20px;
  line-height: 1;
  display: block;
  max-width: 100%;
  height: auto;
}

.radio-img-label {
  font-size: 11px;
  font-weight: 500;
}

.radio-img.is-selected {
  border-color: var(--accent-2);
  background: rgba(109, 87, 159, 0.06);
  box-shadow: 0 0 0 2px rgba(139, 111, 224, 0.25);
}

/* Wrapper, damit Label + Info-Button schön in einer Reihe sind */
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

/* Label im Wrapper soll keinen eigenen bottom-margin mehr haben */
.field-label label {
  margin-bottom: 0;
}

/* kleiner runder Info-Button mit "i" */
.info-btn {
  border: none;
  background: #f1f5f9;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-2);
  padding: 0;
}

.info-btn:hover {
  background: rgba(109, 87, 159, 0.12);
}


/* Charakter-Modus-Toggle */

.choice-group {
  display: flex;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

.choice-group .btn {
  flex: 1;
  height: 30px;
  border-radius: 999px;
  padding-block: 8px;
  font-size: 13px;
  border: none;
  background: transparent;
}

/* Aktiver Modus anhand sichtbarer Paneels */

.card:has(.appearance[style*='display: block']) .choice-group button[data-mode='manual'],
.card:has(.photo[style*='display: block']) .choice-group button[data-mode='photo'] {
  background: #ffffff;
  color: #0f172a;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Buttons & Toolbar */

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.btn.primary {
  background: linear-gradient(180deg, #7e67c8, #6D579F);
  border-color: #6D579F;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(109, 87, 159, 0.35);
  min-width: 300px;
  width: 50%;
}

.btn.primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(109, 87, 159, 0.25);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Story-Optionen / Karten */

.cards3 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cards3 .option-card {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor:pointer;
}

.option-card[aria-selected='true'],
.is-selected {
  outline: 2px solid var(--accent-2);
}

.option-card .img {
  position: relative;
  height: 190px;
  border-radius: 16px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-img-bg {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.option-img-emoji {
  font-size: 64px;
}

.option-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
}

.option-card-header h4 {
  margin: 0;
  font-size: 18px;
}

/* Nur der Bildinhalt soll animiert werden, nicht der Container */
.option-card .img {
  /* Falls du vorher schon transform-Animation drauf hattest, hier explizit ausknipsen */
  transform: none;
}

/* Basis: SVG / IMG / Background-Div vorbereiten */
.option-card .img svg,
.option-card .img img,
.option-card .img .option-img-bg {
  transition: transform 0.25s ease, filter 0.25s ease;
  will-change: transform;
}

/* Hover: nur das Motiv "kommt nach vorne" */
@media (hover: hover) and (pointer: fine) {
  .cards3 .option-card:hover .img svg,
  .cards3 .option-card:hover .img img,
  .cards3 .option-card:hover .img .option-img-bg {
    transform: translateY(-4px) scale(1.02);
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.15));
  }
}


.option-info-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--accent-2);
  width: 30px;
  height: 30px;
  display:flex;
  justify-content: center;
  align-items:center;
}

.option-info-btn:hover {
  background: rgba(109, 87, 159, 0.08);
}

/* Summary */

.summary {
  display: grid;
  gap: 14px;
  padding-left: 4px;
}

.summary blockquote {
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.summary .row {
  display: grid;
  margin: 0px;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 10px;
}

.summary .row strong {
  text-transform: capitalize;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-edit {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--accent-2);
  padding: 4px;
  border-radius: 999px;
}

.summary-edit:hover {
  background: rgba(109, 87, 159, 0.08);
}

.jsonout {
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* Preview / Story-Generator */

.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
}

.preview-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
  grid-template-areas:
    "story   image"
    "toolbar image";
  gap: 24px 16px;
  align-items: flex-start;
}

/* Grid-Areas zuweisen */
.preview-text {
  grid-area: story;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-image {
  grid-area: image;
}

/* Toolbar im Grid – wir nutzen weiterhin die allgemeine .toolbar-Styles,
   ergänzen aber Layout-spezifische Einstellungen */
.preview-toolbar {
  grid-area: toolbar;
  margin-top: 8px;
  justify-content: flex-start; /* links unter dem Text auf Desktop */
}

/* Container für die Titelbild-Vorschau */
.preview-image {
  position: relative;
  width: 100%;
  overflow: visible; /* Buch darf unten rausgucken */
}

/* Container für die Titelbild-Vorschau */
.preview-image {
  position: relative;
  width: 100%;
  overflow: visible; /* Buch darf unten rausgucken */
}

/* Maskierter Rahmen für das Titelbild (PNG-Maske mit Alpha) */
.preview-image .img-shell {
  position: relative;
  width: 100%;
  padding-top: 150%; /* 2:3 Hochformat */
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #e2e8f0;

  /* PNG mit Transparenz: Wolke deckend, außen transparent */
  -webkit-mask-image: url("https://cdn.pixfizz.com/fz/df8715e90c/0/Gi6Pfv9b6IVORAjUCRk1TFuoJYzW_24UhLSZiGI9ELo/~/Maske-neu-01.png");
  mask-image: url("https://cdn.pixfizz.com/fz/df8715e90c/0/Gi6Pfv9b6IVORAjUCRk1TFuoJYzW_24UhLSZiGI9ELo/~/Maske-neu-01.png");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-position: center;
  mask-position: center;
}


/* Nur das eigentliche Titelbild füllt den maskierten Rahmen */
#preview-title-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
  user-select: none;
  pointer-events: none;
}



/* Buch liegt unten mittig vor der Wolke und ragt etwas heraus */
.preview-book-overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;          /* weiter nach unten – nur oberer Teil überlappt die Wolke */
  width: 100%;            /* etwas kleiner, damit das Bild sichtbar bleibt */
  max-width: 420px;      /* auf großen Screens nicht zu riesig */
  height: auto;
  pointer-events: none;
  z-index: 4;            /* sicher vor dem Titelbild */
}



.preview-img-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.preview-img-overlay-inner {
  border-radius: 999px;
  padding: 16px;
  animation: ldt-pulse 1.5s ease-in-out infinite;
}

.preview-img-overlay-icon {
  display: block;
  font-size: 80px;
}

.preview-img-overlay-icon img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.img-loading {
  position: absolute;
  inset: 0;
  animation: ldt-shimmer 1.2s linear infinite;
  background: linear-gradient(90deg, #e2e8f0 0%, #f8fafc 50%, #e2e8f0 100%);
  background-size: 200% 100%;
}

.preview-error {
  color: #b91c1c;
  margin-top: 12px;
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent);
  animation: ldt-spin 0.8s linear infinite;
}

.preview-progress {
  width: 100%;
  max-width: 420px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 4px;
}

.preview-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #7e67c8, #6D579F);
  transition: width 0.3s linear;
}

.preview-hints {
  min-height: 1.4em;
  font-size: 13px;
  color: #475569;
  text-align: center;
}

.preview-hint-line {
  margin: 4px 0 0;
}

/* Modals */

.ldt-modal.hidden {
  display: none;
}

.ldt-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ldt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.ldt-modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.style-info-modal {
  align-items: flex-start;
  text-align: left;
  max-width: 640px;
}

.style-info-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.style-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  width: 100%;
}

.style-info-grid img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Animations */

@keyframes ldt-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes ldt-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ldt-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.9;
  }
}

/* Responsive */

@media (max-width: 1024px) {
  .cards3 .option-card {
    flex: 1 1 calc(50% - 8px);
  }
}

@media (max-width: 768px) {

  .preview-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "story"
      "image"
      "toolbar";
  }

  .preview-toolbar {
    margin-top: 12px;
    justify-content: center; /* Buttons zentriert unter dem Bild */
  }

  .main-container {
    padding-inline: 16px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cards3 {
    flex-direction: column;
  }

  .cards3 .option-card {
    flex: 1 1 auto;
  }

  .breadcrumbs,
  .story-bc {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .breadcrumbs::-webkit-scrollbar,
  .story-bc::-webkit-scrollbar {
    display: none;
  }

  .crumb,
  .story-step {
    flex: 0 0 auto;
  }

  .swatches,
  .image-radios {
    gap: 12px;
  }

  .radio-img {
    width: 90px;
    min-height: 96px;
  }

  .panel {
    padding: 16px 14px 20px;
  }

  .preview-layout {
    grid-template-columns: 1fr;
  }


}

@media (max-width: 640px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .btn {
    width: 100%;
    justify-content: center;
  }

  .option-card .img {
    height: 160px;
  }
}

/* Mobiles "kleben"-Badge (robust auch bei Carousel/transform) */
@media (max-width: 768px) {
  .sticky-char-badge {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        justify-content: center;
        align-items: center;
        height: 65px;
        margin-bottom: 5px;
        background: #f1f5f9;
        border: 1px solid var(--border);
        padding-top: env(safe-area-inset-top);
        padding-left: 12px;
        padding-right: 12px;
        z-index: 10000;
        display: none;
        width: 100%;
        box-shadow: 0px 3px 10px #d7d7d7;
  }
  

  .sticky-char-badge.is-visible {
    display: flex;
  }

  .sticky-char-badge .badge {
    margin: 0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 16px !important;
    max-width: 720px;
    height: 44px;         /* mobil etwas kompakter */
    margin-bottom: 0;     /* in der Bar kein Abstand nach unten */
  }
}

/* Sticky Footer nur mobil (für Step-Toolbar) */
@media (max-width: 768px) {
  .toolbar-sticky-mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;

    /* Optik */
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);

    /* Spacing + iPhone Home-Indikator */
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));

    /* Layout: zwei Buttons nebeneinander */
    margin-top: 0;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    flex-direction:row;
  }

  /* Buttons im Sticky-Footer sollen flexibel sein */
  .toolbar-sticky-mobile .btn {
    flex: 1;
    width: auto;              /* überschreibt dein mobile 100% */
    justify-content: center;
  }

  /* Wichtig: dein .btn.primary hat min-width:300px und width:50% -> mobil killen */
  .toolbar-sticky-mobile .btn.primary {
    min-width: 0;
    width: 100%;
  }

  /* Damit Inhalt nicht unter dem Footer verschwindet */
  .panel {
    padding-bottom: calc(20px + 86px + env(safe-area-inset-bottom));
  }
}


/* Flex Column Nebencharaktere */
@media (max-width: 768px) {
.flex-column-mobile {
    display:flex;
    flex-direction:column;
    align-items:center
  }
}

@media (max-width: 768px) {
  .sticky-char-badge {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;

    padding-top: env(safe-area-inset-top);
    z-index: 10000;

    display: none;

    background: rgb(148 133 193);
    color:white;
    backdrop-filter: blur(10px);
    border: 1px solid rgb(148 133 193);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }

  .sticky-char-badge.is-visible {
    display: block;
  }

  .sticky-char-badge__inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 10px 12px;

    display: flex;
    align-items: center;
    gap: 10px;
  }

  .sticky-char-badge__inner .badge {
    flex: 1;
    height: 44px;
    margin: 0;
    font-size: 14px;
    overflow:scroll;
  }

  .sticky-char-badge__inner .nav-btn {
    width: 44px;
    height: 44px;
  }

  .sticky-char-badge__inner .nav-btn:disabled {
    opacity: 0.4;
    cursor: default;
  }
}
