/* Pure RP Livechat — IONOS 1:1 launcher + widget v14 */
#pr-livechat-root {
    --lc-blue: #0b5cab;
    --lc-blue-dark: #003d8f;
    --lc-ionos-blue: #1474c4;
    --lc-ionos-teaser: linear-gradient(90deg, #003d8f 0%, #0b5cab 100%);
    --lc-text: #1a1a2e;
    --lc-muted: #6b7280;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 100001;
    pointer-events: none;
}

#pr-livechat-root * { box-sizing: border-box; }

#pr-livechat-root button,
#pr-livechat-root input,
#pr-livechat-root textarea {
    width: auto;
    margin: 0;
    font-family: inherit;
    letter-spacing: normal;
    text-transform: none;
    transform: none;
    box-shadow: none;
}

#pr-livechat-root button {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    overflow: visible;
    position: relative;
    cursor: pointer;
}

#pr-livechat-root button::before,
#pr-livechat-root button::after {
    display: none !important;
    content: none !important;
}

#pr-livechat-root button:hover:not(:disabled),
#pr-livechat-root button:active:not(:disabled),
#pr-livechat-root button:focus {
    transform: none;
    box-shadow: none;
}

#pr-livechat-root .lc-pill,
#pr-livechat-root .lc-teaser,
#pr-livechat-root .lc-promo,
#pr-livechat-root .lc-panel {
    pointer-events: auto;
}

/* ── IONOS-Schritte: nur ein Element sichtbar ── */
.lc-pill,
.lc-teaser,
.lc-promo,
.lc-panel {
    display: none;
}

#pr-livechat-root[data-step="pill"] .lc-pill { display: flex; }
#pr-livechat-root[data-step="teaser"] .lc-teaser { display: block; }
#pr-livechat-root[data-step="promo"] .lc-promo { display: block; }
#pr-livechat-root[data-step="chat"] .lc-panel { display: flex; }

/* ── Schritt 1: IONOS Minimize-Button (runder weißer Launcher) ── */
.lc-pill {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    z-index: 100002;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lc-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.lc-pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.lc-pill-icon svg {
    display: block;
    width: 28px;
    height: 28px;
}

.lc-pill-live {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}

/* ── Schritt 2: IONOS Teaser-Leiste ── */
.lc-teaser {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 100003;
    width: min(340px, calc(100vw - 40px));
}

.lc-teaser-main {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    min-height: 56px;
    padding: 0.4rem 2.4rem 0.4rem 0.4rem;
    border: none;
    border-radius: 999px;
    background: var(--lc-ionos-teaser);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0, 61, 143, 0.38);
    text-align: left;
    transition: filter 0.15s ease;
}

.lc-teaser-main:hover { filter: brightness(1.04); }

.lc-teaser-photo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lc-teaser-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lc-teaser-copy {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    flex: 1;
}

.lc-teaser-kicker {
    font-size: 0.6875rem;
    line-height: 1.2;
    opacity: 0.92;
}

.lc-teaser-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.15;
}

.lc-teaser-more {
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0.95;
    padding-right: 0.15rem;
    flex-shrink: 0;
}

.lc-teaser-close {
    position: absolute;
    top: -6px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #003d8f;
    font-size: 0.65rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Schritt 3: IONOS Promo-Karte ── */
.lc-promo {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: min(292px, calc(100vw - 40px));
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
    z-index: 100004;
    overflow: hidden;
    color: var(--lc-text);
}

.lc-promo-head {
    padding: 1.1rem 1.15rem 0.85rem;
}

.lc-promo-kicker {
    margin: 0;
    font-size: 0.68rem;
    color: var(--lc-muted);
}

.lc-promo-title {
    margin: 0.25rem 0 0.45rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--lc-blue-dark);
    line-height: 1.2;
}

.lc-promo-text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--lc-muted);
}

.lc-promo-actions {
    padding: 0 1.15rem 0.85rem;
}

.lc-promo-chat {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 999px;
    background: var(--lc-blue-dark);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
}

.lc-promo-chat:hover { background: var(--lc-ionos-blue); }

.lc-promo-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0.5rem 1rem 0.85rem;
    border-top: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fafbfc, #fff);
}

.lc-promo-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.lc-promo-close {
    border: none;
    background: transparent;
    color: var(--lc-muted);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.35rem;
}

.lc-promo-close:hover { color: var(--lc-text); }

/* ── Schritt 4: Chat-Panel (IONOS-Stil · Pure) ── */
.lc-ionos-panel {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: min(360px, calc(100vw - 40px));
    height: min(520px, calc(100vh - 5rem));
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
    z-index: 100005;
    flex-direction: column;
    overflow: hidden;
    color: #1f2937;
}

.lc-connecting {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
}

.lc-connecting.is-active { display: flex; }

.lc-connecting strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0b5cab;
}

.lc-connecting p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.lc-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dbeafe;
    border-top-color: #0b5cab;
    border-radius: 50%;
    animation: lcSpin 0.85s linear infinite;
}

.lc-chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #fff;
}

.lc-ionos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, #7ec8ff 0%, #5eb3f7 100%);
    border-bottom: 1px solid rgba(255,255,255,0.35);
}

.lc-ionos-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.lc-ionos-header-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.45);
    color: #0f172a;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.lc-ionos-header-btn:hover { background: rgba(255,255,255,0.75); }

.lc-ionos-status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.72rem;
    line-height: 1.35;
    border-bottom: 1px solid #eef2f7;
}

.lc-ionos-status.online { background: #ecfdf5; color: #166534; }
.lc-ionos-status.offline,
.lc-ionos-status.wait { background: #fffbeb; color: #92400e; }

.lc-ionos-status .lc-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lc-ionos-status.online .lc-status-dot { background: #22c55e; }
.lc-ionos-status.offline .lc-status-dot,
.lc-ionos-status.wait .lc-status-dot { background: #f59e0b; }

.lc-ionos-error {
    min-height: 0;
    font-size: 0.72rem;
    color: #dc2626;
    text-align: center;
    padding: 0.25rem 0.75rem;
}

.lc-ionos-error.ok { color: #16a34a; }

.lc-ionos-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.85rem 0.5rem;
    background: #fafbfc;
}

.lc-ionos-intro {
    margin: 0 0 0.85rem;
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
}

.lc-ionos-starter {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.lc-ionos-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.lc-ionos-starter-copy { min-width: 0; flex: 1; }

.lc-ionos-bubble {
    background: #eef2f7;
    color: #1e293b;
    padding: 0.7rem 0.8rem;
    border-radius: 4px 12px 12px 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    word-break: break-word;
}

.lc-ionos-bubble.team { background: #eef2f7; }
.lc-ionos-bubble.user {
    background: linear-gradient(135deg, #0b5cab, #0ea5e9);
    color: #fff;
    border-radius: 12px 4px 12px 12px;
}

.lc-ionos-meta {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.65rem;
    color: #94a3b8;
}

.lc-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lc-ionos-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.lc-ionos-row.user {
    justify-content: flex-end;
}

.lc-ionos-row.user .lc-ionos-bubble-wrap { max-width: 82%; }

.lc-ionos-row.team .lc-ionos-bubble-wrap { max-width: calc(100% - 42px); }

.lc-msg.system {
    align-self: center;
    max-width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #475569;
    text-align: center;
}

.lc-msg.system.waiting { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.lc-msg.system.offline { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.lc-ionos-compose {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 0.65rem 0.75rem 0.75rem;
}

.lc-ionos-guest {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

#pr-livechat-root .lc-ionos-guest-input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-size: 0.78rem;
    transform: none;
    box-shadow: none;
}

#pr-livechat-root .lc-ionos-guest-input:focus {
    outline: none;
    border-color: #0b5cab;
    box-shadow: 0 0 0 3px rgba(11, 92, 171, 0.15);
    transform: none;
}

.lc-ionos-input-wrap {
    position: relative;
    min-height: 72px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

#pr-livechat-root .lc-ionos-input {
    display: block;
    width: 100%;
    min-height: 72px;
    max-height: 120px;
    padding: 0.75rem 3rem 0.75rem 0.85rem;
    border: none;
    background: transparent;
    color: #0f172a;
    font-family: 'Exo 2', system-ui, sans-serif;
    font-size: 0.88rem;
    line-height: 1.45;
    resize: none;
    transform: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

#pr-livechat-root .lc-ionos-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

#pr-livechat-root .lc-ionos-input:focus {
    outline: none;
    transform: none;
    box-shadow: none;
}

.lc-ionos-input-wrap:focus-within {
    border-color: #0b5cab;
    box-shadow: 0 0 0 3px rgba(11, 92, 171, 0.12);
}

#pr-livechat-root .lc-ionos-send {
    position: absolute;
    right: 0.55rem;
    bottom: 0.55rem;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0b5cab, #0ea5e9);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(11, 92, 171, 0.28);
    transform: none;
    padding: 0;
}

#pr-livechat-root .lc-ionos-send:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.lc-ionos-input-wrap.is-locked {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.lc-ionos-input-wrap.is-locked .lc-ionos-send {
    opacity: 0.35;
    pointer-events: none;
}

#pr-livechat-root .lc-ionos-input:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

#pr-livechat-root .lc-ionos-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

@keyframes lcSpin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
    .lc-guest-row,
    .lc-ionos-guest { grid-template-columns: 1fr; }
    .lc-teaser-main { padding-right: 2rem; }
    .lc-ionos-panel,
    .lc-teaser,
    .lc-promo { width: calc(100vw - 32px); left: 16px; bottom: 16px; }
    .lc-pill { left: 16px; bottom: 16px; }
}
