/* Dateipfad: assets/css/bi-partner-vorschau.css
   Live-Vorschau einer Partner-Anzeige (assets/js/bi-partner-vorschau.js): Gerät (Handy / Computer), hell oder dunkel, nachgebaute Seite
   von BeInvited – der Kasten selbst kommt aus assets/css/bi-partner.css (gleiche Klassen wie auf der Webseite).
   Das Handy ist dasselbe wie bei den Beispielen «Ohne Event» (assets/css/bi-ohne-event.css, .egl-phone): Gehäuse mit Tasten, Statusleiste
   9:41 mit Insel, Adresszeile, Seite scrollt ohne sichtbare Scrollleiste, Pfeil «weiter unten», Home-Balken.
   Aufbau: .bpv-device (Gehäuse bzw. Fenster, trägt die Farben hell/dunkel) › .bpv-win (Bildschirm) › Statusleiste + Adresszeile (Handy) bzw.
   Fensterleiste (Computer) · .bpv-screen (scrollt) · .bpv-more · .bpv-homebar */

.bpv { min-width: 0; }
.bpv-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.bpv-sel { display: flex; gap: 8px; align-items: center; flex: 1 1 220px; min-width: 0; font-size: 0.8rem; font-weight: 800; color: var(--text-muted, #64748b); }
.bpv-sel select { flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--border-color, #e2e8f0); border-radius: 10px; font: inherit; font-size: 0.86rem; font-weight: 600; background: var(--bg-card, #fff); color: var(--text-main, #0f172a); }
/* Umschalter ruhig wie ein Segment-Schalter: gewählt = weisse Fläche */
.bpv-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 11px; background: var(--bg-hover, #f1f5f9); }
.bpv-seg button { border: 0; border-radius: 8px; background: transparent; color: var(--text-muted, #64748b); font: inherit; font-size: 0.78rem; font-weight: 800; padding: 6px 10px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.bpv-seg button:hover { color: var(--text-main, #0f172a); }
.bpv-seg button.is-on { background: var(--bg-card, #fff); color: var(--text-main, #0f172a); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.bpv-seg button:focus-visible { outline: 2px solid var(--primary-color, #2771c8); outline-offset: 1px; }
.bpv-stage { display: flex; justify-content: center; padding: 22px 10px; border-radius: 18px; background: var(--bg-hover, #f1f5f9); overflow: hidden; }
.bpv-cap { margin: 8px 0 0; font-size: 0.78rem; color: var(--text-muted, #64748b); text-align: center; }
.bpv-off { color: #b45309; }

/* Gerät */
.bpv-device { --bg-body: #f8fafc; --bg-card: #ffffff; --bg-hover: #f1f5f9; --text-main: #0f172a; --text-muted: #64748b; --border-color: #e2e8f0; --primary-color: #2771c8;
    --bpv-url: rgba(15, 23, 42, 0.06); --bpv-bar: rgba(15, 23, 42, 0.82);
    position: relative; max-width: 100%; color: var(--text-main); font-family: "Segoe UI", Roboto, sans-serif; text-align: left; box-sizing: border-box; }
.bpv-device[data-theme="dark"] { --bg-body: #0f172a; --bg-card: #1e293b; --bg-hover: #334155; --text-main: #f1f5f9; --text-muted: #94a3b8; --border-color: #334155; --primary-color: #4f8fe0;
    --bpv-url: rgba(255, 255, 255, 0.09); --bpv-bar: rgba(241, 245, 249, 0.85); }
.bpv-win { position: relative; background: var(--bg-body); }
.bpv-chrome, .bpv-status, .bpv-url, .bpv-more, .bpv-homebar { display: none; }
.bpv-screen { padding: 12px; box-sizing: border-box; }

/* Handy (wie .egl-phone in assets/css/bi-ohne-event.css) */
.bpv-device.is-phone { width: 364px; background: #0b1220; border-radius: 56px; padding: 11px;
    box-shadow: inset 0 0 0 2px #2b3446, inset 0 0 0 5px #0b1220, 0 2px 0 1px #1e293b, 0 34px 60px -18px rgba(15, 23, 42, 0.45), 0 14px 28px rgba(15, 23, 42, 0.12); }
/* Seitentasten: links laut/leise, rechts Ein/Aus */
.bpv-device.is-phone::before, .bpv-device.is-phone::after { content: ""; position: absolute; width: 3px; border-radius: 2px; background: #1e293b; }
.bpv-device.is-phone::before { left: -3px; top: 150px; height: 92px; background: linear-gradient(#1e293b 0 40px, transparent 40px 52px, #1e293b 52px 92px); }
.bpv-device.is-phone::after { right: -3px; top: 168px; height: 70px; }
.bpv-device.is-phone .bpv-win { display: flex; flex-direction: column; isolation: isolate; overflow: hidden; border-radius: 45px; height: clamp(540px, calc(100vh - 190px), 680px); }
.bpv-device.is-phone .bpv-status { flex: none; position: relative; height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 4px 26px 0 34px; box-sizing: border-box; color: var(--text-main); }
.bpv-time { font-size: 0.86rem; font-weight: 800; letter-spacing: 0.2px; font-variant-numeric: tabular-nums; }
.bpv-island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 98px; height: 29px; border-radius: 16px; background: #0b1220; }
.bpv-icons { display: inline-flex; align-items: center; gap: 5px; }
.bpv-icons svg { display: block; fill: currentColor; }
.bpv-device.is-phone .bpv-url { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 14px 8px; height: 32px; border-radius: 11px; background: var(--bpv-url); font-size: 0.78rem; font-weight: 600; color: var(--text-main); }
.bpv-url i { font-size: 0.66rem; color: var(--text-muted); }
.bpv-device.is-phone .bpv-screen { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 6px 12px 34px; scrollbar-width: none; -ms-overflow-style: none; outline: none; }
.bpv-device.is-phone .bpv-screen::-webkit-scrollbar { display: none; width: 0; height: 0; }
.bpv-device.is-phone .bpv-screen:focus-visible { box-shadow: inset 0 0 0 2px var(--primary-color); }
/* Unten weich ausblenden, solange es weitergeht */
.bpv-device.is-phone .bpv-win::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; z-index: 2; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg-body) 78%); transition: opacity 0.25s ease; }
.bpv-device.is-phone .bpv-win.is-end::after { opacity: 0; }
.bpv-device.is-phone .bpv-more { position: absolute; left: 50%; bottom: 22px; z-index: 3; transform: translateX(-50%); width: 38px; height: 38px; border-radius: 50%; padding: 0;
    border: 1px solid var(--border-color); background: var(--bg-card); color: var(--primary-color); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
    display: flex; align-items: center; justify-content: center; font-size: 0.85rem; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; animation: bpvNudge 2.2s ease-in-out infinite; }
.bpv-device.is-phone .bpv-win:not(.is-scrolled):not(.is-end) .bpv-more { opacity: 1; pointer-events: auto; }
@keyframes bpvNudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 4px); } }
.bpv-device.is-phone .bpv-homebar { display: block; position: absolute; left: 50%; bottom: 8px; z-index: 3; transform: translateX(-50%); width: 124px; height: 5px; border-radius: 3px; background: var(--bpv-bar); pointer-events: none; }

/* Computer: Browserfenster */
.bpv-device.is-desktop { width: 100%; max-width: 760px; border-radius: 14px; overflow: hidden; border: 1px solid rgba(15, 23, 42, 0.12); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16); }
.bpv-device.is-desktop[data-theme="dark"] { border-color: #334155; }
.bpv-device.is-desktop .bpv-chrome { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--bg-hover); border-bottom: 1px solid var(--border-color); }
.bpv-chrome i { width: 9px; height: 9px; border-radius: 50%; background: #f87171; }
.bpv-chrome i:nth-child(2) { background: #fbbf24; }
.bpv-chrome i:nth-child(3) { background: #34d399; }
.bpv-chrome span { margin-left: 10px; flex: 1; font-size: 0.7rem; color: var(--text-muted); background: var(--bg-card); border-radius: 999px; padding: 3px 10px; }
.bpv-device.is-desktop .bpv-screen { padding: 16px 20px 20px; min-height: 380px; max-height: 560px; overflow-y: auto; }

/* Nachgebaute Seite */
.bpv-top { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.bpv-brand { font-size: 0.8rem; font-weight: 900; color: var(--primary-color); display: inline-flex; gap: 6px; align-items: center; }
.bpv-av { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #a78bfa, #f472b6); }
.bpv-pagehead { margin: 0 0 10px; }
.bpv-pagehead small { display: block; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.bpv-pagehead b { display: block; font-size: 1.02rem; }
.bpv-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.bpv-tabs span { font-size: 0.7rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border-color); color: var(--text-muted); background: var(--bg-card); }
.bpv-tabs span.is-on { background: var(--text-main); color: var(--bg-card); border-color: var(--text-main); }
.bpv-sk { display: flex; flex-direction: column; gap: 7px; padding: 12px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-card); }
.bpv-sk i { display: block; height: 9px; border-radius: 6px; background: var(--bg-hover); }
.bpv-paper { position: relative; height: 120px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border-color); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 4px 4px 0 var(--bg-hover); }
.bpv-paper i { display: block; height: 8px; border-radius: 5px; background: var(--bg-hover); width: 80%; }
.bpv-paper i:nth-child(2) { width: 60%; }
.bpv-paper i:nth-child(3) { width: 70%; }
.bpv-paper span { position: absolute; right: 14px; bottom: 12px; width: 34px; height: 34px; border-radius: 6px; background: repeating-linear-gradient(45deg, var(--text-muted) 0 3px, transparent 3px 6px); opacity: 0.35; }
.bpv-inv { margin: -12px -12px 0; }
.bpv-device.is-phone .bpv-inv { margin: -6px -12px 0; }
.bpv-device.is-desktop .bpv-inv { margin: -16px -20px 0; }
.bpv-hero { padding: 26px 16px 22px; text-align: center; color: #fff; background: linear-gradient(135deg, #7c3aed, #db2777 60%, #f59e0b); }
.bpv-hero small { display: block; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; }
.bpv-hero b { display: block; font-size: 1.25rem; margin: 4px 0; }
.bpv-hero span { font-size: 0.76rem; opacity: 0.92; }
.bpv-inv > .bpv-ok, .bpv-inv > .bpv-pagehead, .bpv-inv > .bpv-sk, .bpv-inv > .kp-box { margin-left: 12px; margin-right: 12px; }
.bpv-device.is-desktop .bpv-inv > .bpv-ok, .bpv-device.is-desktop .bpv-inv > .bpv-pagehead, .bpv-device.is-desktop .bpv-inv > .bpv-sk, .bpv-device.is-desktop .bpv-inv > .kp-box { margin-left: 20px; margin-right: 20px; }
.bpv-ok { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(16, 185, 129, 0.12); color: #047857; font-size: 0.82rem; font-weight: 800; }
.bpv-device[data-theme="dark"] .bpv-ok { color: #6ee7b7; }
.bpv-inv > .bpv-pagehead { margin-top: 12px; }

/* Kasten in der Vorschau: wie auf der Webseite, nur ohne Klicks */
.bpv-box { margin-top: 14px; }
.bpv-box > summary { cursor: default; }
.bpv-box .kp-btn { cursor: default; }
/* Platzhalter, solange kein Logo bzw. Bild da ist: ruhig in der Farbe der Webseite */
.bpv-logoph { display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.8rem; color: #fff; background: var(--primary-color); border: 0; }
.bpv-imgph { display: flex; align-items: center; justify-content: center; font-size: 1.7rem; color: var(--primary-color); aspect-ratio: 16 / 9; max-height: 180px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 16%, var(--bg-card)), color-mix(in srgb, var(--primary-color) 6%, var(--bg-card))); }
.bpv-device.is-desktop .kp-list { grid-template-columns: repeat(auto-fill, minmax(220px, 280px)); }
/* Auf dem Handy wie auf der Webseite unter 520 px (assets/css/bi-partner.css) */
.bpv-device.is-phone .kp-box > summary { padding: 12px; gap: 10px; }
.bpv-device.is-phone .kp-list { padding: 0 12px 12px; grid-template-columns: minmax(0, 1fr); }
.bpv-device.is-phone .kp-foot { padding: 10px 12px 12px; }

/* Touch: am Ende scrollt die Seite weiter; der Pfeil ist nur ein Hinweis */
@media (pointer: coarse) {
    .bpv-device.is-phone .bpv-screen { overscroll-behavior-y: auto; }
    .bpv-device.is-phone .bpv-win:not(.is-scrolled):not(.is-end) .bpv-more { pointer-events: none; width: 32px; height: 32px; bottom: 20px; font-size: 0.75rem; }
}
@media (max-width: 520px) {
    .bpv-seg button span { display: none; }
    .bpv-stage { padding: 14px 4px; }
    .bpv-device.is-phone { width: 348px; border-radius: 50px; padding: 9px; }
    .bpv-device.is-phone .bpv-win { border-radius: 41px; height: min(620px, 74vh); height: min(620px, 74svh); }
    .bpv-device.is-phone .bpv-screen { padding-left: 9px; padding-right: 9px; }
    .bpv-device.is-phone .bpv-inv { margin-left: -9px; margin-right: -9px; }
}
@media (prefers-reduced-motion: reduce) { .bpv-device.is-phone .bpv-more { animation: none; } }
