/* ============================================================================
   BsDemoHub — Premium Live-Demo-Hub für miraBOOK (Welle 2026-05-25)
   ----------------------------------------------------------------------------
   Pattern: Sidebar-links + Browser-Frame-iframe-rechts, Dark-Stage drumherum.
   2026-Style nach ShadCN/Linear/Vercel-Templates-Recherche.
   ============================================================================ */

/* ─── Section-Wrapper & Stage-Background ───────────────────────────────── */
.bs-demo-hub {
  min-height: 100vh;
  /* Default (Light-Mode): sanfter Light-Gradient mit cyan-Akzent oben */
  background: linear-gradient(180deg, #f5f8fc 0%, #eaf0f7 50%, #f0f4fa 100%);
  color: #0A1B33;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.bs-demo-hub::before {
  content: '';
  position: absolute;
  inset: -20% -20% auto -20%;
  height: 60%;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(20, 152, 213, 0.10), transparent 60%),
    radial-gradient(ellipse at 70% 0%, rgba(62, 182, 240, 0.08), transparent 55%);
  z-index: 0;
  pointer-events: none;
}
/* Dark-Mode: dunkler Gradient + stärkerer Glow */
body.is-dark-bg .bs-demo-hub {
  background: linear-gradient(180deg, #08101e 0%, #0a1426 50%, #050a16 100%);
  color: #F0F4FA;
}
body.is-dark-bg .bs-demo-hub::before {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(20, 152, 213, 0.18), transparent 60%),
    radial-gradient(ellipse at 70% 0%, rgba(62, 182, 240, 0.12), transparent 55%);
}

/* ─── Topbar (Hero-Strip) — Mobile-First: vertical Stack ──────────────────
   Back-Btn (klein, oben) → Eyebrow+Title (mittel) → Sub (Lauftext).
   Desktop ab 1024px wechselt zu Grid mit Back-Btn links. */
.bs-demo-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
  max-width: 1680px;
  margin: 0 auto;
}
.bs-demo-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(10, 27, 51, 0.65);
  text-decoration: none;
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  border: 1px solid rgba(10, 27, 51, 0.12);
  border-radius: 999px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.bs-demo-back:hover {
  color: #0A1B33;
  border-color: rgba(10, 27, 51, 0.30);
  background: rgba(10, 27, 51, 0.04);
}
body.is-dark-bg .bs-demo-back {
  color: rgba(240, 244, 250, 0.65);
  border-color: rgba(240, 244, 250, 0.12);
}
body.is-dark-bg .bs-demo-back:hover {
  color: #F0F4FA;
  border-color: rgba(240, 244, 250, 0.30);
  background: rgba(240, 244, 250, 0.04);
}
.bs-demo-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.bs-demo-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #1498D5;
}
body.is-dark-bg .bs-demo-eyebrow { color: #3EB6F0; }

.bs-demo-title {
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #0A1B33;
  margin: 0;
}
body.is-dark-bg .bs-demo-title { color: #F0F4FA; }

.bs-demo-sub {
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(10, 27, 51, 0.65);
  max-width: 64ch;
  margin: 0;
}
body.is-dark-bg .bs-demo-sub { color: rgba(240, 244, 250, 0.65); }

/* ─── Stage: Sidebar + Viewport ────────────────────────────────────────── */
.bs-demo-stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem) clamp(2rem, 5vw, 4rem);
  max-width: 1680px;
  margin: 0 auto;
}
/* Grid-Items dürfen nicht über die Spalte hinauswachsen (Mobile-Overflow-Fix).
   Default ist min-width: auto = intrinsic min-content size — bei Toolbars
   mit nowrap-Buttons + iframe macht das die Spalte 1600px+ breit auf 393px viewport. */
.bs-demo-sidebar,
.bs-demo-viewport {
  min-width: 0;
  max-width: 100%;
}

/* ─── Sidebar (Mobile-First: 3×3 Grid Picker, Desktop: vertical Card) ──
   Mobile: 9 Branchen-Pills in 3 Spalten × 3 Reihen (alle sichtbar, kein hidden state).
   Pills compact: icon oben, name darunter, sub-text weg.
   Desktop: vertikale Card mit voll-formatigen Pills + Footer (siehe weiter unten). */
.bs-demo-sidebar {
  position: relative;
}
/* Mobile: Inner ist transparent (kein Card-Border) */
.bs-demo-sidebar-inner {
  display: contents;
}
.bs-demo-sidebar-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  padding: 0.25rem 0 0.5rem;
}
/* Footer ist nur Desktop sichtbar — Mobile = display:none */
.bs-demo-sidebar-footer {
  display: none;
}

/* Pill (Sidebar-Item) — Mobile: compact grid-card (icon oben + name darunter)
   Desktop: vertikale Liste mit icon links + name+sub rechts (siehe @media 1024+). */
.bs-demo-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(10, 27, 51, 0.08);
  border-radius: 12px;
  color: rgba(10, 27, 51, 0.75);
  cursor: pointer;
  text-align: center;
  min-height: 88px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  font-family: inherit;
  --demo-accent: #1498D5;
}
.bs-demo-pill:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(10, 27, 51, 0.16);
  color: #0A1B33;
  transform: translateY(-1px);
}
.bs-demo-pill.is-active {
  background: #ffffff;
  border-color: rgba(10, 27, 51, 0.22);
  color: #0A1B33;
  box-shadow:
    0 0 0 1px var(--demo-accent),
    0 8px 24px -8px color-mix(in srgb, var(--demo-accent) 35%, transparent);
}

body.is-dark-bg .bs-demo-pill {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(240, 244, 250, 0.75);
}
body.is-dark-bg .bs-demo-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #F0F4FA;
}
body.is-dark-bg .bs-demo-pill.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow:
    0 0 0 1px var(--demo-accent),
    0 8px 24px -8px color-mix(in srgb, var(--demo-accent) 50%, transparent);
}

/* Accent-Bar: Mobile = unsichtbar (Grid-Cards nutzen Border + Shadow als Active-Indicator).
   Desktop (1024+) = vertikale Bar links, siehe weiter unten. */
.bs-demo-pill-accent {
  display: none;
}

.bs-demo-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: color-mix(in srgb, var(--demo-accent) 15%, transparent);
  color: var(--demo-accent);
  border-radius: 9px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.bs-demo-pill.is-active .bs-demo-pill-icon {
  background: color-mix(in srgb, var(--demo-accent) 25%, transparent);
}

.bs-demo-pill-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  align-items: center;
  width: 100%;
}
.bs-demo-pill-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: inherit;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
/* Sub-Text auf Mobile weg (zu wenig Platz in Grid-Card), nur Desktop sichtbar */
.bs-demo-pill-sub {
  display: none;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(10, 27, 51, 0.50);
  letter-spacing: -0.005em;
}
.bs-demo-pill.is-active .bs-demo-pill-sub {
  color: rgba(10, 27, 51, 0.70);
}
body.is-dark-bg .bs-demo-pill-sub {
  color: rgba(240, 244, 250, 0.50);
}
body.is-dark-bg .bs-demo-pill.is-active .bs-demo-pill-sub {
  color: rgba(240, 244, 250, 0.70);
}

/* ─── Viewport: Browser-Frame + Iframe ─────────────────────────────────── */
.bs-demo-viewport {
  position: relative;
  width: 100%;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 60px -16px rgba(0, 0, 0, 0.45),
    0 48px 120px -32px color-mix(in srgb, var(--demo-accent, #1498D5) 30%, transparent);
  /* aspect-ratio prevents CLS during iframe-load */
  --demo-accent: #1498D5;
}
body.is-dark-bg .bs-demo-viewport,
.bs-demo-hub .bs-demo-viewport {
  background: #ffffff;
}

/* Toolbar oberhalb iframe — Frame-Controls (Customer + Admin + Password + Fullscreen).
   Background passt sich an iframe-bg an (light = neutral grau, dark = neutral dunkel)
   damit kein harter Schnitt zum iframe-Content entsteht. Light-Default-Mode (parent body
   ohne is-dark-bg) zeigt LIGHT-Toolbar. Dark-Mode override unten. */
.bs-demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: #f7f8fa;
  border-bottom: 1px solid rgba(10, 27, 51, 0.08);
  flex-shrink: 0;
}
body.is-dark-bg .bs-demo-toolbar {
  background: #0d1830;
  border-bottom-color: rgba(240, 244, 250, 0.08);
}
.bs-demo-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 auto;
}
.bs-demo-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding-left: 0.5rem;
  border-left: 1px solid rgba(10, 27, 51, 0.08);
}
body.is-dark-bg .bs-demo-toolbar-right {
  border-left-color: rgba(240, 244, 250, 0.08);
}

/* Frame-Wrap: enthält iframe + Skeleton-Overlay. flex:1 damit iframe verfügbare Höhe nimmt */
.bs-demo-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Viewport muss flex column werden damit Toolbar oben + iframe-wrap unten */
.bs-demo-viewport {
  display: flex;
  flex-direction: column;
}

/* Action-Buttons (Customer + Admin + Fullscreen) — ALLE gleiche Höhe (1-zeilig) */
.bs-demo-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(10, 27, 51, 0.78);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
  height: 34px;
  box-sizing: border-box;
}
.bs-demo-action:hover {
  background: rgba(10, 27, 51, 0.06);
  border-color: rgba(10, 27, 51, 0.12);
  color: #0A1B33;
  transform: translateY(-1px);
}
body.is-dark-bg .bs-demo-action {
  color: rgba(240, 244, 250, 0.82);
}
body.is-dark-bg .bs-demo-action:hover {
  background: rgba(240, 244, 250, 0.08);
  border-color: rgba(240, 244, 250, 0.14);
  color: #ffffff;
}

/* Customer-Variant: blue accent (primäre Demo-Action) */
.bs-demo-action--customer {
  background: rgba(20, 152, 213, 0.12);
  border-color: rgba(20, 152, 213, 0.22);
  color: #0E7BB0;
}
.bs-demo-action--customer:hover {
  background: rgba(20, 152, 213, 0.20);
  border-color: rgba(20, 152, 213, 0.40);
  color: #075A85;
}
body.is-dark-bg .bs-demo-action--customer {
  background: rgba(62, 182, 240, 0.16);
  border-color: rgba(62, 182, 240, 0.30);
  color: #7DD3FC;
}
body.is-dark-bg .bs-demo-action--customer:hover {
  background: rgba(62, 182, 240, 0.26);
  border-color: rgba(62, 182, 240, 0.48);
  color: #BAE6FD;
}

/* Admin-Variant: subtle neutral (sekundär, weniger laut) */
.bs-demo-action--admin {
  background: rgba(10, 27, 51, 0.04);
  border-color: rgba(10, 27, 51, 0.10);
}
.bs-demo-action--admin:hover {
  background: rgba(10, 27, 51, 0.08);
  border-color: rgba(10, 27, 51, 0.18);
}
body.is-dark-bg .bs-demo-action--admin {
  background: rgba(240, 244, 250, 0.05);
  border-color: rgba(240, 244, 250, 0.12);
}
body.is-dark-bg .bs-demo-action--admin:hover {
  background: rgba(240, 244, 250, 0.10);
  border-color: rgba(240, 244, 250, 0.22);
}

/* Fullscreen-Icon-only Button */
.bs-demo-action--icon {
  padding: 0;
  width: 34px;
  justify-content: center;
}
.bs-demo-action--icon:hover {
  transform: none;
}

/* Password-Chip: separates "Copy"-Element (klick → kopiert Password ins Clipboard).
   Optisch klar als "kopierbar" markiert (Copy-Icon + Mono-Font). */
.bs-demo-pwd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.7rem 0 0.6rem;
  background: rgba(10, 27, 51, 0.04);
  border: 1px dashed rgba(10, 27, 51, 0.16);
  border-radius: 8px;
  color: rgba(10, 27, 51, 0.60);
  font-size: 0.72rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}
.bs-demo-pwd-chip:hover {
  background: rgba(10, 27, 51, 0.07);
  border-color: rgba(10, 27, 51, 0.28);
  border-style: solid;
  color: #0A1B33;
  transform: translateY(-1px);
}
body.is-dark-bg .bs-demo-pwd-chip {
  background: rgba(240, 244, 250, 0.04);
  border-color: rgba(240, 244, 250, 0.18);
  color: rgba(240, 244, 250, 0.60);
}
body.is-dark-bg .bs-demo-pwd-chip:hover {
  background: rgba(240, 244, 250, 0.08);
  border-color: rgba(240, 244, 250, 0.32);
  color: #ffffff;
}
.bs-demo-pwd-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}
.bs-demo-pwd-value {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(10, 27, 51, 0.06);
  color: rgba(10, 27, 51, 0.85);
}
body.is-dark-bg .bs-demo-pwd-value {
  background: rgba(240, 244, 250, 0.08);
  color: rgba(240, 244, 250, 0.92);
}

/* Password-Chip — Copied-State (1.8s flash grün) */
.bs-demo-pwd-chip.is-copied {
  background: rgba(6, 199, 85, 0.10);
  border-color: rgba(6, 199, 85, 0.45);
  border-style: solid;
  color: #058B47;
}
.bs-demo-pwd-chip.is-copied .bs-demo-pwd-value {
  background: rgba(6, 199, 85, 0.18);
  color: #058B47;
}
body.is-dark-bg .bs-demo-pwd-chip.is-copied {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.45);
  color: #4ADE80;
}
body.is-dark-bg .bs-demo-pwd-chip.is-copied .bs-demo-pwd-value {
  background: rgba(74, 222, 128, 0.20);
  color: #4ADE80;
}

/* Long/Short Label-Toggle: Desktop nutzt langes Label ("Open customer view"),
   Mobile nutzt kurzes ("Customer"). CSS toggled via display. */
.bs-demo-action-label--short {
  display: none;
}

/* ═══ Mobile-Toolbar (<640px): 2-row Grid-Layout ═══
   Row 1: [Customer-CTA primary] [Admin neutral] [⛶]
   Row 2: [Password-Chip volle Breite]
   Labels BLEIBEN sichtbar (kurze Variante), klare Button-Hierarchie. */
/* ─── Mobile-Branch-Select: hidden on Desktop, sichtbar auf Mobile ────────
   Native iOS Sheet-Picker / Android Wheel statt horizontaler Scroll-Sidebar.
   Eine Zeile UI (44px), keine Scroll-Probleme, premium native UX. */
.bs-demo-mobile-branch {
  display: none;  /* default hidden — wird auf Mobile via @media sichtbar */
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Demo-Layout (Welle 2026-05-26 v4): natural Page-Scroll
   ----------------------------------------------------------------------------
   Body-Scroll erlaubt. Demo-UI (Topbar+Select+Toolbar) scrollt natürlich mit
   weg. iframe nimmt ~100dvh damit App-Page reinpasst ohne internes Scrollen
   in den meisten Fällen. User kann durch die ganze Seite scrollen.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 639px) {
  /* Mobile: Native Select sichtbar, Sidebar (Pill-Liste) hidden */
  .bs-demo-mobile-branch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0.75rem 0.5rem;
    padding: 0 0.85rem;
    height: 44px;
    background: var(--bs-demo-surface, rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    position: relative;
    flex-shrink: 0;
  }
  body:not(.is-dark-bg) .bs-demo-mobile-branch {
    background: rgba(10, 27, 51, 0.04);
    border-color: rgba(10, 27, 51, 0.10);
  }
  .bs-demo-mobile-branch-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: rgba(240, 244, 250, 0.55);
    pointer-events: none;
  }
  body:not(.is-dark-bg) .bs-demo-mobile-branch-label {
    color: rgba(10, 27, 51, 0.55);
  }
  .bs-demo-mobile-branch-select {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0 1.25rem 0 0;
    cursor: pointer;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }
  .bs-demo-mobile-branch-select:focus {
    outline: none;
  }
  .bs-demo-mobile-branch-chevron {
    position: absolute;
    right: 0.85rem;
    pointer-events: none;
    opacity: 0.55;
  }

  /* Sidebar (Pill-Liste) auf Mobile komplett hidden — wird durch Select ersetzt */
  body.is-demo-fullscreen-mobile .bs-demo-sidebar {
    display: none;
  }

  /* Fullscreen-Button auf Mobile verstecken — iOS Safari unterstützt
     iframe-Fullscreen schlecht, plus Phone ist eh schon nahezu Vollbild.
     Mit iframe-resizer (postMessage) ist iframe-Höhe sowieso optimal.
     Auf Desktop bleibt der Button sinnvoll (Detail-Tests im großen Frame). */
  body.is-demo-fullscreen-mobile #bs-demo-fullscreen {
    display: none;
  }

  /* Hub: kein fixed-Layout, normales Scroll-Behavior, padding-top für Nav-Bar.
     Nav-Bar ist position:fixed mit 73px Höhe → ohne padding-top wäre die
     Topbar darunter versteckt. */
  body.is-demo-fullscreen-mobile .bs-demo-hub {
    padding: 73px 0 1rem;
    min-height: 0;
  }

  /* iframe-Höhe wird per postMessage von embed.js dynamisch gesetzt
     (inline style überschreibt diese Werte). CSS hier ist nur Fallback
     wenn JS nicht lädt: min 480px, max viewport. */
  body.is-demo-fullscreen-mobile .bs-demo-frame {
    width: 100%;
    height: calc(100dvh - 60px);
    min-height: 480px;
    max-height: none;
    box-sizing: border-box;
  }
  @supports not (height: 100dvh) {
    body.is-demo-fullscreen-mobile .bs-demo-frame { height: calc(100vh - 60px); }
  }

  /* ═══════════════════════════════════════════════════════════════════════
     Mobile Demo-Hub Layout (Welle 2026-05-26 v2):
     Maximize iframe-Real-Estate — slim topbar + horizontale Sidebar + große iframe.
     Verhindert das "gequetscht"-Gefühl wo iframe nur 60vh kriegt.
     ═══════════════════════════════════════════════════════════════════════ */

  /* Topbar SLIM: Eyebrow + Sub weg, nur Back + Title sichtbar.
     Spart ~60px vertikalen Platz für iframe. */
  .bs-demo-topbar {
    padding: 0.75rem 1rem 0.5rem;
    gap: 0.4rem;
  }
  .bs-demo-eyebrow,
  .bs-demo-sub {
    display: none;
  }
  .bs-demo-title {
    font-size: 1.05rem;
    font-weight: 700;
  }
  .bs-demo-back {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem 0.3rem 0.45rem;
  }

  /* Stage: weniger Padding für mehr iframe-Platz */
  .bs-demo-stage {
    gap: 0.5rem;
    padding: 0 0.5rem 1rem;
  }

  /* Sidebar als horizontaler Scroller (statt 3×3 Grid).
     Branchen sind ein horizontaler swipe — spart vertikalen Platz. */
  .bs-demo-sidebar-list {
    display: flex;
    grid-template-columns: none;
    gap: 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0.25rem 0.5rem;
    /* Subtle Fade an den Edges, signalisiert "es geht weiter" */
    mask-image: linear-gradient(90deg, transparent 0, black 8px, black calc(100% - 8px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, black 8px, black calc(100% - 8px), transparent 100%);
  }
  .bs-demo-pill {
    flex: 0 0 auto;
    flex-direction: row;
    min-height: 0;
    padding: 0.5rem 0.75rem 0.5rem 0.55rem;
    gap: 0.5rem;
    border-radius: 999px;
    scroll-snap-align: start;
  }
  .bs-demo-pill-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }
  .bs-demo-pill-icon svg {
    width: 13px;
    height: 13px;
  }
  .bs-demo-pill-text {
    flex-direction: row;
    align-items: center;
    width: auto;
  }
  .bs-demo-pill-sub {
    display: none;  /* Mobile: nur Name, kein Sub-Text */
  }
  .bs-demo-pill-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
  }

  /* iframe nimmt restliche Höhe — 100dvh minus headers/toolbar/sidebar/footer.
     dvh = dynamic viewport height (excludes mobile-browser-UI). */
  .bs-demo-frame {
    height: calc(100dvh - 220px);
    min-height: 480px;
    max-height: none;
  }
  /* Fallback für ältere Browser ohne dvh */
  @supports not (height: 100dvh) {
    .bs-demo-frame { height: calc(100vh - 220px); }
  }

  /* Long-Label weg, Short-Label rein */
  .bs-demo-action-label--long {
    display: none;
  }
  .bs-demo-action-label--short {
    display: inline-block;
  }

  .bs-demo-toolbar {
    display: grid;
    /* Fullscreen-Button auf Mobile hidden → keine auto-Spalte mehr.
       Customer+Admin sind je 1fr → zusammen = pwd-chip-Breite (full row). */
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "customer admin"
      "pwd      pwd";
    gap: 0.45rem;
    padding: 0.5rem 0.55rem;
  }
  .bs-demo-toolbar-left,
  .bs-demo-toolbar-right {
    display: contents;
  }
  #bs-demo-newtab-customer { grid-area: customer; justify-content: center; }
  #bs-demo-newtab-admin    { grid-area: admin;    justify-content: center; }
  #bs-demo-pwd-chip        { grid-area: pwd;      justify-content: center; }

  .bs-demo-action {
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    min-width: 0;
    gap: 0.4rem;
  }
  .bs-demo-action-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Customer-Btn auf Mobile: klare PRIMARY CTA (gefüllter blue background, weiße Schrift) */
  .bs-demo-action--customer {
    background: #1498D5;
    border-color: #1498D5;
    color: #ffffff;
  }
  .bs-demo-action--customer:hover {
    background: #0E7BB0;
    border-color: #0E7BB0;
    color: #ffffff;
  }
  body.is-dark-bg .bs-demo-action--customer {
    background: #3EB6F0;
    border-color: #3EB6F0;
    color: #0A1B33;
  }
  body.is-dark-bg .bs-demo-action--customer:hover {
    background: #7DD3FC;
    border-color: #7DD3FC;
    color: #0A1B33;
  }

  /* Password-Chip: cleaner solid border statt dashed, klar als "Copy"-Button erkennbar */
  .bs-demo-pwd-chip {
    justify-content: center;
    width: 100%;
    border-style: solid;
    background: rgba(10, 27, 51, 0.05);
  }
  body.is-dark-bg .bs-demo-pwd-chip {
    background: rgba(240, 244, 250, 0.06);
  }
  /* Password-Label "Admin Login" sichtbar lassen für Klarheit */
  .bs-demo-pwd-label {
    display: inline-block;
  }
}

/* Iframe — Mobile-First: kompakte Höhe (weniger leerer Platz bei kurzen Demo-Steps).
   Desktop ab 1024px überschreibt zu height:100% via align-self:stretch (siehe unten). */
.bs-demo-frame {
  display: block;
  width: 100%;
  height: clamp(440px, 60vh, 640px);
  border: 0;
  background: #ffffff;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.bs-demo-frame.is-loading {
  opacity: 0;
}
/* Dark-Mode: iframe-Bg dunkel — Demo selbst ist weiß, aber während Load
   verhindert das den weißen Flash bevor das Demo gerendert ist. */
body.is-dark-bg .bs-demo-frame {
  background: #0a1426;
}

/* Skeleton-Loader (während iframe lädt) — deckt iframe komplett ab */
.bs-demo-skeleton {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(135deg, #f7f8fc, #eef2f8);
  pointer-events: none;
  z-index: 2;
}
body.is-dark-bg .bs-demo-skeleton {
  background: linear-gradient(135deg, #0d1830, #08101e);
}
.bs-demo-skeleton.is-visible {
  display: flex;
}
.bs-demo-skeleton-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(20, 152, 213, 0.15);
  border-top-color: var(--demo-accent, #1498D5);
  animation: bs-demo-spin 0.9s linear infinite;
}
body.is-dark-bg .bs-demo-skeleton-spinner {
  border-color: rgba(62, 182, 240, 0.18);
  border-top-color: var(--demo-accent, #3EB6F0);
}
@keyframes bs-demo-spin {
  to { transform: rotate(360deg); }
}
.bs-demo-skeleton-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.40);
  letter-spacing: 0.02em;
}
body.is-dark-bg .bs-demo-skeleton-text {
  color: rgba(240, 244, 250, 0.50);
}

/* Credentials-Pill entfernt (Welle 2026-05-26):
   Password ist jetzt im Admin-Button-Sublabel + wird beim Klick automatisch
   ins Clipboard kopiert (siehe booking-system-demo.js). Spart Bildschirmplatz
   unten rechts und reduziert Login-Flow von 5 auf 1 Schritt. */

/* ─── Desktop Layout (≥1024px): Sidebar links, Viewport rechts ─────────── */
@media (min-width: 1024px) {
  .bs-demo-topbar {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto auto;
    gap: 0.6rem 2rem;
    align-items: center;
    padding-bottom: 2rem;
  }
  .bs-demo-back {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    padding: 0.4rem 0.8rem 0.4rem 0.55rem;
  }
  .bs-demo-title-block {
    grid-column: 2;
    grid-row: 1;
  }
  .bs-demo-sub {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.92rem;
  }

  .bs-demo-stage {
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: stretch;
  }

  .bs-demo-sidebar {
    position: sticky;
    top: 1rem;
    align-self: start;
    /* KEIN forced height mehr — Card hat natürliche Höhe (Pills + Footer).
       Iframe matched diese Höhe unten via .bs-demo-frame Override. */
  }
  /* Desktop: Inner wird zum sichtbaren Card-Container */
  .bs-demo-sidebar-inner {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(10, 27, 51, 0.08);
    border-radius: 14px;
    padding: 0.6rem;
    box-shadow:
      0 0 0 1px rgba(10, 27, 51, 0.02),
      0 8px 24px -12px rgba(10, 27, 51, 0.10);
  }
  body.is-dark-bg .bs-demo-sidebar-inner {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.04),
      0 8px 24px -12px rgba(0, 0, 0, 0.40);
  }
  .bs-demo-sidebar-list {
    /* Mobile-Default ist display:grid (3 cols) — Desktop zurück zu flex column */
    display: flex;
    flex-direction: column;
    flex: 1;
    grid-template-columns: none;
    gap: 0.45rem;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 14rem);
    scroll-snap-type: none;
    padding: 0.1rem;
  }
  /* Sidebar-Footer: Reset-Info, sitzt direkt unter den Pills (kein margin-top:auto mehr) */
  .bs-demo-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.75rem 0.55rem;
    margin-top: 0.6rem;
    border-top: 1px solid rgba(10, 27, 51, 0.08);
    color: rgba(10, 27, 51, 0.55);
    flex-shrink: 0;
  }
  body.is-dark-bg .bs-demo-sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
    color: rgba(240, 244, 250, 0.55);
  }
  .bs-demo-sidebar-footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: color-mix(in srgb, #1498D5 12%, transparent);
    color: #1498D5;
    flex-shrink: 0;
  }
  body.is-dark-bg .bs-demo-sidebar-footer-icon {
    background: rgba(62, 182, 240, 0.16);
    color: #3EB6F0;
  }
  .bs-demo-sidebar-footer-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
  }
  .bs-demo-sidebar-footer-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(10, 27, 51, 0.78);
    letter-spacing: -0.005em;
    line-height: 1.2;
  }
  body.is-dark-bg .bs-demo-sidebar-footer-title {
    color: rgba(240, 244, 250, 0.82);
  }
  .bs-demo-sidebar-footer-sub {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(10, 27, 51, 0.45);
  }
  body.is-dark-bg .bs-demo-sidebar-footer-sub {
    color: rgba(240, 244, 250, 0.45);
  }
  /* Desktop-Pills: zurück zu horizontal-Liste-Style (icon links, name+sub rechts) */
  .bs-demo-pill {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 0.7rem;
    white-space: normal;
    width: 100%;
    min-height: 0;
    padding: 0.75rem 0.85rem 0.75rem 1rem;
  }
  .bs-demo-pill-icon {
    width: 38px;
    height: 38px;
  }
  .bs-demo-pill-text {
    align-items: flex-start;
    width: auto;
  }
  .bs-demo-pill-name {
    font-size: 0.88rem;
    white-space: normal;
    text-align: left;
    overflow: visible;
    text-overflow: clip;
  }
  /* Sub-Text wieder sichtbar auf Desktop */
  .bs-demo-pill-sub {
    display: block;
    font-size: 0.72rem;
  }
  /* Accent-Bar wieder sichtbar auf Desktop (vertikale Bar links) */
  .bs-demo-pill-accent {
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    background: var(--demo-accent);
    border-radius: 0 3px 3px 0;
    transform: translateY(-50%);
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .bs-demo-pill.is-active .bs-demo-pill-accent {
    height: 60%;
  }
  /* Iframe-Höhe matched natürliche Sidebar-Card-Höhe (~720px bei 9 Pills + Footer).
     Iframe-Viewport stretched sich via align-items:stretch im Grid. */
  .bs-demo-viewport {
    align-self: stretch;
  }
  .bs-demo-frame {
    height: 100%;
    min-height: 600px;
    max-height: none;
  }
}

/* ─── Reduced-Motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bs-demo-skeleton-spinner { animation: none; }
  .bs-demo-pill, .bs-demo-back, .bs-demo-frame, .bs-demo-creds-value {
    transition: none;
  }
}

/* ─── Fullscreen-Mode (native API) ──────────────────────────────────────── */
.bs-demo-viewport:fullscreen {
  display: flex;
  flex-direction: column;
  background: #000000;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
.bs-demo-viewport:fullscreen .bs-demo-frame {
  flex: 1;
  height: auto;
  min-height: 0;
  max-height: none;
}
