/* ============================================================
   LackPlus Chat Widget — lp-chat.css
   ============================================================ */

/* ── Chat Toast Notification ─────────────────────────────── */
.lp-chat-toast {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    max-width: 420px;
    min-width: 280px;
    cursor: pointer;
    transition: top .4s cubic-bezier(.22,1,.36,1), opacity .4s;
    opacity: 0;
}
.lp-chat-toast.show {
    top: 20px;
    opacity: 1;
}
.lp-chat-toast.hide {
    top: -80px;
    opacity: 0;
}
.lp-chat-toast:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.1);
}
.lp-chat-toast-av {
    width: 38px; height: 38px; border-radius: 50%;
    background: #3399ff; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
    overflow: visible;
    position: relative;
}
.lp-chat-toast-av img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.lp-chat-toast-av-badge {
    position: absolute;
    right: -4px; bottom: -4px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #3399ff;
    color: #fff;
    border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.lp-chat-toast-av-badge svg { width: 10px; height: 10px; }
.lp-chat-toast-body {
    flex: 1; min-width: 0; overflow: hidden;
}
.lp-chat-toast-name {
    font-size: 13px; font-weight: 700; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-chat-toast-text {
    font-size: 12px; color: #64748b; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-chat-toast-close {
    background: none; border: none; color: #94a3b8;
    font-size: 18px; cursor: pointer; padding: 0 4px;
    line-height: 1; flex-shrink: 0;
}
.lp-chat-toast-close:hover { color: #475569; }

/* ── FAB ─────────────────────────────────────────────────── */
.lp-chat-fab {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0656b0, #0783ff);
    color: #fff;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(37,99,235,.45), 0 1px 4px rgba(0,0,0,.15);
    z-index: 9100;
    transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
}
.lp-chat-fab:hover  { transform: scale(1.08); box-shadow: 0 6px 22px rgba(37,99,235,.55); }
.lp-chat-fab:active { transform: scale(.95); }

.lp-chat-fab-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 1;
    min-width: 18px; height: 18px;
    border-radius: 9px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.lp-chat-fab-badge--hidden { display: none !important; }
.lp-chat-fab-badge--dot {
    min-width: 12px; width: 12px; height: 12px;
    padding: 0;
    border-radius: 50%;
    top: -2px; right: -2px;
    font-size: 0;
}

/* ── Widget ──────────────────────────────────────────────── */
.lp-chat-widget {
    position: fixed;
    bottom: 24px; right: 28px;
    width: 800px; height: 670px;
    min-width: 460px; min-height: 420px;
    max-width: calc(100vw - 24px); max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.06);
    display: flex; flex-direction: column;
    z-index: 9099;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: opacity .22s ease, transform .22s cubic-bezier(.34,1.2,.64,1);
}
.lp-chat-widget--hidden {
    opacity: 0; transform: translateY(12px) scale(.96); pointer-events: none;
}

/* Compact (pinned) mode — small dock bottom-right that persists across pages */
.lp-chat-widget--compact {
    width: 380px !important; height: 520px !important;
    bottom: 18px; right: 18px;
}
.lp-chat-widget--compact .lp-cw-sidebar {
    width: 150px; min-width: 150px;
}
.lp-chat-widget--compact .lp-cw-action-btn span,
.lp-chat-widget--compact .lp-cw-send-btn span { display: none; }
.lp-chat-widget--compact .lp-cw-resize-handle { display: none; }
@media (max-width: 480px) {
    .lp-chat-widget--compact { width: calc(100vw - 20px) !important; right: 10px; }
}

/* Resize handle (top-left corner) — drag to resize */
.lp-cw-resize-handle {
    position: absolute;
    top: 0; left: 0;
    width: 18px; height: 18px;
    cursor: nwse-resize;
    z-index: 9410;
    background:
        linear-gradient(135deg,
            transparent 0, transparent 30%,
            rgba(37,99,235,.55) 30%, rgba(37,99,235,.55) 38%,
            transparent 38%, transparent 50%,
            rgba(37,99,235,.55) 50%, rgba(37,99,235,.55) 58%,
            transparent 58%, transparent 70%,
            rgba(37,99,235,.55) 70%, rgba(37,99,235,.55) 78%,
            transparent 78%);
    border-top-left-radius: 16px;
    opacity: .45;
    transition: opacity .15s ease;
}
.lp-cw-resize-handle:hover { opacity: 1; }
.lp-chat-widget.is-resizing { transition: none; user-select: none; }
.lp-chat-widget.is-resizing * { user-select: none !important; pointer-events: none; }
.lp-chat-widget.is-resizing .lp-cw-resize-handle { pointer-events: auto; }
.lp-chat-widget--dark .lp-cw-resize-handle {
    background:
        linear-gradient(135deg,
            transparent 0, transparent 30%,
            rgba(96,165,250,.55) 30%, rgba(96,165,250,.55) 38%,
            transparent 38%, transparent 50%,
            rgba(96,165,250,.55) 50%, rgba(96,165,250,.55) 58%,
            transparent 58%, transparent 70%,
            rgba(96,165,250,.55) 70%, rgba(96,165,250,.55) 78%,
            transparent 78%);
}

/* Drag & Drop overlay */
.lp-cw-drop-overlay {
    position: absolute; inset: 0;
    background: rgba(37, 99, 235, .92);
    color: #fff;
    display: none;
    align-items: center; justify-content: center;
    z-index: 9400;
    border-radius: 16px;
    pointer-events: none;
}
.lp-chat-widget.is-dragover .lp-cw-drop-overlay { display: flex; }
.lp-cw-drop-overlay__inner {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 24px 32px;
    border: 2px dashed rgba(255,255,255,.7);
    border-radius: 14px;
    font-size: 15px; font-weight: 600;
    text-align: center;
}

/* ── Header ──────────────────────────────────────────────── */
.lp-cw-header {
    background: linear-gradient(120deg, #064a96 0%, #0783ff 60%, #3399ff 100%);
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
    position: relative;
}
.lp-cw-header__title {
    display: flex; align-items: center; gap: 9px;
    color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .01em;
}
.lp-cw-header__title svg { opacity: .9; }
.lp-cw-unread-pill {
    background: #ef4444; color: #fff;
    font-size: 10.5px; font-weight: 700;
    padding: 2px 9px; border-radius: 999px; line-height: 1.5;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.lp-cw-close,
.lp-cw-header-btn {
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
    padding: 0;
}
.lp-cw-close:hover,
.lp-cw-header-btn:hover { background: rgba(255,255,255,.28); }

.lp-cw-header__actions {
    display: flex; align-items: center; gap: 6px;
}
.lp-cw-header-btn.is-active {
    background: #fff; color: #0783ff;
}

/* ── Settings View (volle Seite im Chat) ─────────────────── */
.lp-cw-settings-view {
    position: absolute;
    inset: 56px 0 0 0; /* unter dem Header */
    background: #fff;
    display: flex;
    flex-direction: column;
    z-index: 9150;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}
.lp-chat-widget--settings .lp-cw-tabs,
.lp-chat-widget--settings .lp-cw-body { display: none !important; }

.lp-cw-settings-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e9eef3;
    background: #f8fafc;
    flex-shrink: 0;
}
.lp-cw-settings-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.lp-cw-settings-back {
    display: flex; align-items: center; gap: 5px;
    background: none; border: none; cursor: pointer;
    color: #475569; font-size: 12.5px; font-weight: 500;
    padding: 5px 8px; border-radius: 6px;
    transition: background .12s, color .12s;
}
.lp-cw-settings-back:hover { background: #e2e8f0; color: #1e293b; }

.lp-cw-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}
.lp-cw-settings-body::-webkit-scrollbar { width: 4px; }
.lp-cw-settings-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.lp-cw-settings-section {
    margin-bottom: 22px;
}
.lp-cw-settings-section-title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.lp-cw-settings-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
}
.lp-cw-settings-row-text { min-width: 0; flex: 1; }
.lp-cw-settings-row-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}
.lp-cw-settings-row-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

/* Toggle switch */
.lp-cw-switch {
    position: relative;
    display: inline-block;
    width: 38px; height: 22px;
    flex-shrink: 0;
}
.lp-cw-switch input { opacity: 0; width: 0; height: 0; }
.lp-cw-switch-slider {
    position: absolute; cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 22px;
    transition: background .18s;
}
.lp-cw-switch-slider::before {
    content: '';
    position: absolute;
    height: 18px; width: 18px;
    left: 2px; top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform .18s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.lp-cw-switch input:checked + .lp-cw-switch-slider { background: #0783ff; }
.lp-cw-switch input:checked + .lp-cw-switch-slider::before { transform: translateX(16px); }

.lp-cw-settings-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
}
.lp-cw-settings-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
.lp-cw-settings-btn:active { background: #cbd5e1; }
.lp-chat-widget--dark .lp-cw-settings-btn {
    background: #1e293b; border-color: #334155; color: #e2e8f0;
}
.lp-chat-widget--dark .lp-cw-settings-btn:hover {
    background: #2a3a55; border-color: #475569;
}

/* Segmented control für Badge-Stil */
.lp-cw-segmented {
    display: inline-flex;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}
.lp-cw-segmented-btn {
    background: transparent;
    border: none;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.lp-cw-segmented-btn.active {
    background: #0783ff;
    color: #fff;
}
.lp-cw-segmented-btn:hover:not(.active) {
    background: #e2e8f0;
}
.lp-chat-widget--dark .lp-cw-segmented {
    background: #1e293b; border-color: #334155;
}
.lp-chat-widget--dark .lp-cw-segmented-btn { color: #cbd5e1; }
.lp-chat-widget--dark .lp-cw-segmented-btn:hover:not(.active) {
    background: #334155;
}

/* ── Tabs ────────────────────────────────────────────────── */
.lp-cw-tabs {
    display: flex; align-items: center;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 8px;
    flex-shrink: 0;
    gap: 2px;
}
.lp-cw-tab {
    display: flex; align-items: center; gap: 5px;
    padding: 10px 12px;
    font-size: 13px; font-weight: 500; color: #64748b;
    background: none; border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; cursor: pointer;
    transition: color .15s, border-color .15s;
    position: relative;
}
.lp-cw-tab:hover { color: #334155; }
.lp-cw-tab--active { color: #0783ff; border-bottom-color: #0783ff; font-weight: 600; }
.lp-cw-tab svg { flex-shrink: 0; }
.lp-cw-tab--active svg { color: #0783ff; }

/* Tab unread badge */
.lp-tab-badge {
    background: #ef4444; color: #fff;
    font-size: 9.5px; font-weight: 700; line-height: 1;
    min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Manage gear */
.lp-cw-manage-btn {
    margin-left: auto;
    background: none; border: none; color: #94a3b8;
    cursor: pointer; padding: 6px 8px;
    border-radius: 6px; display: flex; align-items: center;
    transition: color .15s, background .15s;
}
.lp-cw-manage-btn:hover { color: #0783ff; background: #eff6ff; }

/* ── Body ────────────────────────────────────────────────── */
.lp-cw-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* ── Sidebar ─────────────────────────────────────────────── */
.lp-cw-sidebar {
    width: 240px; min-width: 240px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex; flex-direction: column;
    overflow: hidden; min-height: 0;
}
.lp-cw-search {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 11px;
    border-bottom: 1px solid #e2e8f0;
    color: #b0bec5; flex-shrink: 0;
    background: #f8fafc;
}
.lp-cw-search input {
    flex: 1; min-width: 0;
    background: none; border: none; outline: none;
    font-size: 12.5px; color: #334155;
}
.lp-cw-search input::placeholder { color: #b0bec5; }

.lp-cw-chan-list {
    flex: 1; overflow-y: auto; padding: 6px 0; min-height: 0;
}
.lp-cw-chan-list::-webkit-scrollbar { width: 3px; }
.lp-cw-chan-list::-webkit-scrollbar-thumb { background: #dde3eb; border-radius: 2px; }

.lp-cw-loading { font-size: 12px; color: #b0bec5; padding: 12px 12px; }

/* ── Channel item ────────────────────────────────────────── */
.lp-cw-chan-item {
    display: flex; align-items: flex-start;
    padding: 8px 10px 8px 9px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background .12s;
    gap: 7px;
    /* NO position:relative needed for new layout */
}
.lp-cw-chan-item:hover { background: #f1f5f9; }
.lp-cw-chan-item--active {
    background: linear-gradient(90deg, #eff6ff 0%, #f8fbff 100%);
    border-left-color: #0783ff;
}
.lp-cw-chan-item--active .lp-cw-ci-name { color: #0656b0; font-weight: 700; }

/* Channel color dot — always shows channel-specific color */
.lp-cw-ci-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #dde3eb; flex-shrink: 0; margin-top: 5px;
}
.lp-cw-ci-dot--c0 { background: #0783ff; }
.lp-cw-ci-dot--c1 { background: #7c3aed; }
.lp-cw-ci-dot--c2 { background: #db2777; }
.lp-cw-ci-dot--c3 { background: #059669; }
.lp-cw-ci-dot--c4 { background: #d97706; }
.lp-cw-ci-dot--c5 { background: #0891b2; }
.lp-cw-ci-dot--c6 { background: #9333ea; }
.lp-cw-ci-dot--c7 { background: #16a34a; }

/* Body */
.lp-cw-ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* Row 1: name + time — NO overlap because separate flex items */
.lp-cw-ci-row1 {
    display: flex; align-items: baseline;
    justify-content: space-between; gap: 6px;
}
.lp-cw-ci-name {
    font-size: 12.5px; font-weight: 600; color: #1e293b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.lp-cw-ci-time {
    font-size: 10px; color: #b0bec5;
    white-space: nowrap; flex-shrink: 0;
    /* Explicit ID set per item for JS updates */
}

/* Row 2: preview + badge — inline, no absolute */
.lp-cw-ci-row2 {
    display: flex; align-items: center;
    justify-content: space-between; gap: 6px;
}
.lp-cw-ci-preview {
    font-size: 11.5px; color: #94a3b8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.lp-cw-ci-badge {
    background: #ef4444; color: #fff;
    font-size: 9.5px; font-weight: 700; line-height: 1;
    min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Direct: small avatar wrap with status dot */
.lp-cw-di-wrap { position: relative; flex-shrink: 0; }
.lp-cw-di-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff; overflow: hidden;
}
.lp-cw-di-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Status dots */
.lp-status-dot {
    position: absolute; bottom: -1px; right: -1px;
    width: 9px; height: 9px; border-radius: 50%;
    border: 2px solid #f8fafc;
}
.lp-status-dot--online     { background: #22c55e; }
.lp-status-dot--pause      { background: #f59e0b; }
.lp-status-dot--busy       { background: #ef4444; }
.lp-status-dot--away       { background: #f97316; }
.lp-status-dot--focus      { background: #8b5cf6; }
.lp-status-dot--homeoffice { background: #3399ff; }
.lp-status-dot--vacation   { background: #14b8a6; }
.lp-status-dot--sick       { background: #ec4899; }
.lp-status-dot--offline    { display: none; }

/* ── Eigener Präsenzstatus (Header-Chip + Auswahl-Menü) ──── */
.lp-cw-mystatus { position: relative; }
.lp-cw-mystatus-btn {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.15); border: none; color: #fff;
    height: 30px; padding: 0 9px; border-radius: 8px; cursor: pointer;
    font-size: 12px; font-weight: 600; max-width: 150px;
    transition: background .15s;
}
.lp-cw-mystatus-btn:hover { background: rgba(255,255,255,.28); }
.lp-cw-mystatus-btn .lp-status-dot {
    position: static; width: 9px; height: 9px; border: none; flex-shrink: 0;
}
.lp-cw-mystatus-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-cw-mystatus-btn svg { opacity: .8; flex-shrink: 0; }
/* Offline-Dot im Chip/Menü sichtbar machen (global ist --offline ausgeblendet) */
.lp-cw-mystatus-btn .lp-status-dot--offline,
.lp-cw-status-item .lp-status-dot--offline { display: inline-block; background: #9ca3af; }

.lp-cw-status-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 9300;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    padding: 5px; min-width: 188px;
}
.lp-cw-status-note {
    font-size: 11px; color: #64748b; padding: 6px 8px 7px; line-height: 1.35;
    border-bottom: 1px solid #eef2f7; margin-bottom: 4px;
}
.lp-cw-status-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    background: none; border: none; cursor: pointer;
    padding: 8px 9px; border-radius: 7px; font-size: 13px; color: #1e293b;
    text-align: left;
}
.lp-cw-status-item:hover { background: #f1f5f9; }
.lp-cw-status-item--active { background: #eff6ff; font-weight: 600; }
.lp-cw-status-item .lp-status-dot {
    position: static; width: 10px; height: 10px; border: none; flex-shrink: 0;
}
.lp-chat-widget--dark .lp-cw-status-menu { background: #1e293b; border-color: #334155; }
.lp-chat-widget--dark .lp-cw-status-item { color: #e2e8f0; }
.lp-chat-widget--dark .lp-cw-status-item:hover { background: #334155; }
.lp-chat-widget--dark .lp-cw-status-item--active { background: #172033; }
.lp-chat-widget--dark .lp-cw-status-note { color: #94a3b8; border-color: #334155; }

/* New DM button */
.lp-cw-new-dm {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    margin: 7px 9px 4px;
    padding: 6px 10px;
    background: #fff; border: 1px dashed #c7d2dd; border-radius: 8px;
    color: #64748b; font-size: 12px; cursor: pointer; width: calc(100% - 18px);
    transition: border-color .15s, color .15s, background .15s;
}
.lp-cw-new-dm:hover { border-color: #0783ff; color: #0783ff; background: #eff6ff; }

/* ── Message pane ────────────────────────────────────────── */
.lp-cw-pane {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; min-height: 0; background: #fff;
}

.lp-cw-pane-header {
    padding: 10px 15px;
    border-bottom: 1px solid #e9eef3;
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0; min-height: 43px;
    background: #fdfdfe;
}
.lp-cw-pane-title { font-size: 13.5px; font-weight: 700; color: #0f172a; }

.lp-cw-pane-header-text {
    display: flex; flex-direction: column; gap: 1px;
    min-width: 0; flex: 1;
}

.lp-cw-pane-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* In-Chat-Suche: Lupen-Button im Header */
.lp-cw-msgsearch-btn {
    background: #f1f5f9; border: none; color: #475569;
    width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0;
    transition: background .15s, color .15s; flex-shrink: 0;
}
.lp-cw-msgsearch-btn:hover { background: #e2e8f0; color: #1e293b; }
.lp-cw-msgsearch-btn.is-active { background: #eff6ff; color: #0783ff; }

/* In-Chat-Suche: ausklappbarer Bereich unter dem Header */
.lp-cw-msgsearch {
    flex-shrink: 0;
    border-bottom: 1px solid #e9eef3;
    background: #fff;
}
.lp-cw-msgsearch-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    color: #94a3b8;
}
.lp-cw-msgsearch-bar > svg { flex-shrink: 0; }
#lp-msgsearch-input {
    flex: 1; min-width: 0;
    border: none; outline: none; background: transparent;
    font-size: 13px; color: #1e293b; font-family: inherit;
}
#lp-msgsearch-input::placeholder { color: #94a3b8; }
.lp-cw-msgsearch-count {
    font-size: 11.5px; color: #94a3b8; font-variant-numeric: tabular-nums;
    white-space: nowrap; min-width: 28px; text-align: right;
}
.lp-cw-msgsearch-nav,
.lp-cw-msgsearch-close {
    background: transparent; border: none; cursor: pointer;
    width: 26px; height: 26px; border-radius: 7px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    color: #64748b; transition: background .12s, color .12s;
}
.lp-cw-msgsearch-nav:hover:not(:disabled),
.lp-cw-msgsearch-close:hover { background: #f1f5f9; color: #1e293b; }
.lp-cw-msgsearch-nav:disabled { opacity: .35; cursor: default; }

.lp-cw-msgsearch-results {
    max-height: 230px; overflow-y: auto;
    border-top: 1px solid #f1f5f9;
}
.lp-cw-msgsearch-results:empty { display: none; }
.lp-cw-msgsearch-results::-webkit-scrollbar { width: 4px; }
.lp-cw-msgsearch-results::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.lp-cw-msgsearch-empty {
    padding: 14px; text-align: center; font-size: 12.5px; color: #94a3b8;
}
.lp-cw-msgsearch-item {
    display: flex; flex-direction: column; gap: 2px;
    width: 100%; text-align: left; cursor: pointer;
    background: transparent; border: none;
    padding: 8px 12px; border-bottom: 1px solid #f5f7fa;
    font-family: inherit;
}
.lp-cw-msgsearch-item:hover { background: #f8fafc; }
.lp-cw-msgsearch-item.is-active { background: #eff6ff; }
.lp-cw-msgsearch-item__top {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.lp-cw-msgsearch-item__sender { font-size: 12px; font-weight: 600; color: #334155; }
.lp-cw-msgsearch-item__time   { font-size: 10.5px; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
.lp-cw-msgsearch-item__text {
    font-size: 12.5px; color: #475569; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.lp-cw-msgsearch-item__text mark {
    background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px;
}

/* Verwaltungs-Liste: Trenn-Überschrift für archivierte Kanäle */
.lp-manage-section-head {
    display: flex; align-items: center; gap: 8px;
    margin: 14px 0 2px; padding-top: 12px;
    border-top: 1px solid #e9eef3;
    font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: #94a3b8;
}
.lp-manage-section-count {
    background: #f1f5f9; color: #64748b;
    font-size: 10.5px; font-weight: 600;
    padding: 1px 8px; border-radius: 999px; letter-spacing: 0;
}

.lp-cw-typing {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; color: #16a34a; font-weight: 500;
    line-height: 1.2;
}
.lp-cw-typing-label { white-space: nowrap; }
.lp-cw-typing-dots { display: inline-flex; gap: 2px; }
.lp-cw-typing-dots span {
    width: 4px; height: 4px; border-radius: 50%; background: currentColor;
    animation: lp-cw-typing-bounce 1.2s infinite ease-in-out;
}
.lp-cw-typing-dots span:nth-child(2) { animation-delay: .15s; }
.lp-cw-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes lp-cw-typing-bounce {
    0%, 80%, 100% { opacity: .3; transform: translateY(0); }
    40%           { opacity: 1;  transform: translateY(-2px); }
}
.lp-chat-widget--dark .lp-cw-typing { color: #4ade80; }

/* Badges */
.lp-badge {
    font-size: 10.5px; font-weight: 600;
    padding: 2px 8px; border-radius: 999px; line-height: 1.5; white-space: nowrap;
}
.lp-badge--team   { background: #dbeafe; color: #0656b0; }
.lp-badge--direct { background: #dcfce7; color: #15803d; }
.lp-badge--locked { background: #f1f5f9; color: #64748b; }
.lp-badge--open   { background: #fef3c7; color: #92400e; }
.lp-badge--order  { background: #eff6ff; color: #0656b0; }

/* ── Messages ────────────────────────────────────────────── */
/* Nachrichten-Bereich (Wrapper für Scroll-Pane + Scroll-nach-unten-Button) */
.lp-cw-msgs-area {
    position: relative;
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
}

.lp-cw-messages {
    flex: 1; overflow-y: auto;
    padding: 14px 14px 6px;
    display: flex; flex-direction: column; gap: 1px;
    min-height: 0;
}
.lp-cw-messages::-webkit-scrollbar { width: 4px; }
.lp-cw-messages::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* Kleiner, dezenter Button: zur neuesten Nachricht scrollen */
.lp-cw-scrolldown {
    position: absolute;
    right: 14px; bottom: 12px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid #e7ecf2;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #475569;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    opacity: 0; transform: translateY(8px) scale(0.9);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, background .15s, color .15s;
    z-index: 6;
}
.lp-cw-scrolldown.is-visible {
    opacity: 1; transform: translateY(0) scale(1);
    pointer-events: auto;
}
.lp-cw-scrolldown:hover {
    color: #0783ff; border-color: #bfdbfe;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.22);
}
.lp-cw-scrolldown:active { transform: translateY(0) scale(0.94); }
.lp-cw-scrolldown-badge {
    position: absolute;
    top: -6px; right: -4px;
    min-width: 18px; height: 18px;
    padding: 0 5px; box-sizing: border-box;
    border-radius: 999px;
    background: #ef4444; color: #fff;
    font-size: 10.5px; font-weight: 700; line-height: 18px;
    text-align: center; font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px #fff;
    transition: opacity .4s ease, transform .4s ease;
}
.lp-cw-scrolldown-badge.is-leaving { opacity: 0; transform: scale(0.6); }
.lp-chat-widget--dark .lp-cw-scrolldown-badge { box-shadow: 0 0 0 2px #0f172a; }

.lp-cw-empty {
    color: #b0bec5; font-size: 13px;
    margin: auto; text-align: center; line-height: 1.7;
}

/* Date divider */
.lp-msg-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 18px 0 10px;
}
.lp-msg-divider::before, .lp-msg-divider::after {
    content: ''; flex: 1; height: 1px; background: #e2e8f0;
}
.lp-msg-divider__label {
    background: #f1f5f9; color: #64748b;
    font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase;
    padding: 3px 11px; border-radius: 999px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* Message row */
.lp-msg {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 4px 6px; border-radius: 8px;
    transition: background .1s; position: relative;
}
.lp-msg:hover { background: #f8fafc; }

/* Show sender name only for first in sequence */
.lp-msg--cont .lp-msg-meta { display: none; }
.lp-msg--cont { padding-top: 1px; }
.lp-msg-av-wrap { position: relative; }
.lp-msg--cont .lp-msg-av { visibility: hidden; }
.lp-msg--cont .lp-status-dot { display: none; }

/* Zeitstempel für Folge-Nachrichten — sichtbar statt Avatar */
.lp-msg-cont-time {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 6px;
    text-align: center;
    font-size: 9.5px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -.02em;
    pointer-events: none;
}
.lp-msg--cont .lp-msg-cont-time { display: block; }
.lp-msg--cont:hover .lp-msg-cont-time { color: #475569; }

/* Gap-Indikator: Folge-Nachricht ist deutlich später als die vorige */
.lp-msg--gapped { margin-top: 8px; position: relative; }
.lp-msg--gapped::before {
    content: '';
    position: absolute;
    left: 42px; right: 8px; top: -5px;
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0 12%, #e2e8f0 88%, transparent);
}
.lp-msg--gapped .lp-msg-cont-time {
    color: #0783ff;
    font-weight: 700;
    font-size: 10px;
}

/* Ungelesen-Divider */
.lp-msg-unread-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 0 10px;
}
.lp-msg-unread-divider::before,
.lp-msg-unread-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(to right, transparent, #ef4444 50%, transparent);
}
.lp-msg-unread-divider__label {
    background: #fef2f2; color: #b91c1c;
    font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 11px; border-radius: 999px;
    border: 1px solid #fecaca;
    white-space: nowrap;
}
/* Auto-Ausblenden des "Neue Nachrichten"-Trenners */
.lp-msg-unread-divider--live {
    transition: opacity .4s ease, transform .4s ease, margin .4s ease, max-height .4s ease;
    max-height: 40px;
}
.lp-msg-unread-divider--live.is-leaving {
    opacity: 0; transform: translateY(-4px);
    max-height: 0; margin-top: 0; margin-bottom: 0;
    overflow: hidden;
}

.lp-msg-av-wrap { position: relative; flex-shrink: 0; }
.lp-msg-av {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; overflow: hidden;
    margin-top: 1px; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.lp-msg-av img { width: 100%; height: 100%; object-fit: cover; }
.lp-msg-av-wrap .lp-status-dot { border-color: #fff; width: 8px; height: 8px; }

.lp-msg-body { flex: 1; min-width: 0; }
.lp-msg-meta { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; }
.lp-msg-name { font-size: 13px; font-weight: 700; color: #1e293b; }
.lp-msg-time { font-size: 10.5px; color: #b0bec5; }
/* Hover-Actions: Antworten + ggf. Löschen */
.lp-msg-actions {
    position: absolute; top: 2px; right: 6px;
    display: flex; gap: 2px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(15,23,42,.08);
    opacity: 0; transform: translateY(-2px);
    transition: opacity .15s, transform .15s;
    pointer-events: none;
}
.lp-msg:hover .lp-msg-actions { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lp-msg-action {
    background: none; border: none; cursor: pointer;
    padding: 4px 5px; color: #94a3b8; border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    line-height: 0;
    transition: background .12s, color .12s;
}
.lp-msg-action--reply:hover  { color: #0783ff; background: #eff6ff; }
.lp-msg-action--react:hover  { color: #f59e0b; background: #fffbeb; }
.lp-msg-action--delete:hover { color: #ef4444; background: #fef2f2; }
.lp-msg-action--edit:hover   { color: #0783ff; background: #eff6ff; }
.lp-msg-action--pin:hover    { color: #b45309; background: #fef3c7; }
.lp-msg-action--pin.is-on    { color: #b45309; background: #fef3c7; }

/* ── Pin-Indikator in der Meta-Zeile ── */
.lp-msg-pin-ico {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 8px;
    font-size: 10px;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1;
}
.lp-msg-pin-ico svg { color: #d97706; }
.lp-msg--pinned .lp-msg-body { position: relative; }
.lp-msg--pinned > .lp-msg-body::before {
    /* dezenter linker gelber Akzent-Streifen entlang der Nachricht */
    content: '';
    position: absolute;
    left: -10px; top: 4px; bottom: 4px;
    width: 3px;
    background: linear-gradient(to bottom, #f59e0b, #d97706);
    border-radius: 2px;
}

/* ── "(bearbeitet)" Marker ── */
.lp-msg-edited {
    margin-left: 4px;
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

/* ── Inline-Editor unter der Nachricht ── */
.lp-msg-editor {
    margin-top: 4px;
    background: #fff;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 2px 8px rgba(37,99,235,.12);
}
.lp-msg-editor-input {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    font-size: 14px;
    line-height: 1.4;
    color: #0f172a;
    background: transparent;
    min-height: 32px;
    padding: 0;
}
.lp-msg-editor-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}
.lp-msg-editor-btns {
    display: flex; justify-content: flex-end; gap: 6px;
    margin-top: 6px;
}
.lp-msg-editor-save, .lp-msg-editor-cancel {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter .12s;
}
.lp-msg-editor-save  { background: #0783ff; color: #fff; }
.lp-msg-editor-save:hover  { filter: brightness(1.08); }
.lp-msg-editor-cancel { background: #fff; color: #475569; border-color: #cbd5e1; }
.lp-msg-editor-cancel:hover { background: #f1f5f9; }

/* ── Pinned-Bar oben am Channel ── */
.lp-pin-bar {
    background: linear-gradient(to right, #fffbeb, #fef3c7);
    border-bottom: 1px solid #fde68a;
    padding: 8px 14px;
    flex-shrink: 0;
    max-height: 140px;
    overflow-y: auto;
}
.lp-pin-bar-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.lp-pin-bar-head svg { color: #d97706; }
.lp-pin-bar-count {
    margin-left: 4px;
    background: #fde68a;
    color: #92400e;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 800;
}
.lp-pin-bar-list { display: flex; flex-direction: column; gap: 4px; }
.lp-pin-item {
    position: relative;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 30px 6px 10px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.lp-pin-item:hover { background: #fffbeb; border-color: #fcd34d; }
.lp-pin-item-author {
    font-size: 11px;
    font-weight: 700;
    color: #92400e;
    line-height: 1.2;
}
.lp-pin-item-text {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.35;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lp-pin-item-unpin {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #b45309;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .1s;
}
.lp-pin-item-unpin:hover { background: #fde68a; color: #78350f; }

/* ── Sidebar X-Button (Hide direct chat) ── */
.lp-cw-chan-item { position: relative; }
.lp-cw-ci-hide {
    position: absolute;
    top: 6px; right: 6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,.04);
    border: none;
    color: #94a3b8;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .1s, color .1s;
    line-height: 0;
}
.lp-cw-chan-item:hover .lp-cw-ci-hide { display: inline-flex; }
.lp-cw-ci-hide:hover { background: #fee2e2; color: #dc2626; }

/* Darkmode */
.lp-chat-widget--dark .lp-msg-action--edit:hover { color: #93c5fd; background: #172033; }
.lp-chat-widget--dark .lp-msg-action--pin:hover  { color: #fbbf24; background: #2a1d05; }
.lp-chat-widget--dark .lp-msg-action--pin.is-on  { color: #fbbf24; background: #2a1d05; }
.lp-chat-widget--dark .lp-msg-pin-ico { background: #2a1d05; border-color: #57370a; color: #fcd34d; }
.lp-chat-widget--dark .lp-msg-edited { color: #64748b; }
.lp-chat-widget--dark .lp-msg-editor { background: #0f172a; border-color: #3399ff; }
.lp-chat-widget--dark .lp-msg-editor-input { color: #f1f5f9; }
.lp-chat-widget--dark .lp-msg-editor-cancel { background: #1e293b; color: #cbd5e1; border-color: #334155; }
.lp-chat-widget--dark .lp-msg-editor-cancel:hover { background: #273449; }
.lp-chat-widget--dark .lp-pin-bar {
    background: linear-gradient(to right, #1f1605, #2a1d05);
    border-bottom-color: #3a2a08;
}
.lp-chat-widget--dark .lp-pin-bar-head { color: #fcd34d; }
.lp-chat-widget--dark .lp-pin-bar-count { background: #3a2a08; color: #fde68a; }
.lp-chat-widget--dark .lp-pin-item { background: #0f172a; border-color: #3a2a08; }
.lp-chat-widget--dark .lp-pin-item:hover { background: #1a1106; border-color: #57370a; }
.lp-chat-widget--dark .lp-pin-item-author { color: #fcd34d; }
.lp-chat-widget--dark .lp-pin-item-text { color: #e2e8f0; }
.lp-chat-widget--dark .lp-pin-item-unpin:hover { background: #3a2a08; color: #fde68a; }
.lp-chat-widget--dark .lp-cw-ci-hide { background: rgba(255,255,255,.05); color: #64748b; }
.lp-chat-widget--dark .lp-cw-ci-hide:hover { background: #4c0d0d; color: #f87171; }

/* ── Reaktions-Chips unter der Nachricht (WhatsApp-Stil) ── */
.lp-msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.lp-msg-reactions:not(.has-reactions) { display: none; }

.lp-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    line-height: 1.4;
    transition: background .12s, border-color .12s, transform .08s;
}
.lp-reaction-chip:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}
.lp-reaction-chip:active { transform: scale(.95); }
.lp-reaction-chip.is-reacted {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #0656b0;
}
.lp-reaction-chip.is-reacted:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}
.lp-reaction-emo { font-size: 13px; line-height: 1; }
.lp-reaction-cnt { font-variant-numeric: tabular-nums; }

/* Darkmode */
.lp-chat-widget--dark .lp-reaction-chip {
    background: #1f2937; border-color: #334155; color: #cbd5e1;
}
.lp-chat-widget--dark .lp-reaction-chip:hover {
    background: #273449; border-color: #475569;
}
.lp-chat-widget--dark .lp-reaction-chip.is-reacted {
    background: #064a96; border-color: #3399ff; color: #dbeafe;
}

/* Emoji-Picker-Popover */
.lp-emoji-picker {
    position: fixed;
    z-index: 10080;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .08);
    padding: 6px;
    display: flex;
    gap: 2px;
    animation: lpEmojiPickerIn .14s ease-out;
}
@keyframes lpEmojiPickerIn {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}
.lp-emoji-picker-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background .12s, transform .08s;
}
.lp-emoji-picker-btn:hover {
    background: #f1f5f9;
    transform: scale(1.15);
}
.lp-chat-widget--dark .lp-emoji-picker {
    background: #0f172a; border-color: #334155;
}
.lp-chat-widget--dark .lp-emoji-picker-btn:hover { background: #1e293b; }

/* Reaktions-Info-Popover (WhatsApp-Stil: zeigt wer reagiert hat) */
.lp-reaction-info {
    position: fixed;
    z-index: 10090;
    min-width: 220px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .08);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: lpEmojiPickerIn .14s ease-out;
}
.lp-reaction-info-head {
    padding: 6px 10px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}
.lp-reaction-info-row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.lp-reaction-info-row:hover { background: #f1f5f9; }
.lp-reaction-info-row.is-mine { background: #eff6ff; }
.lp-reaction-info-row.is-mine:hover { background: #dbeafe; }
.lp-reaction-info-emo {
    font-size: 18px;
    line-height: 1;
    text-align: center;
}
.lp-reaction-info-names {
    font-size: 13px;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lp-reaction-info-cnt {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.lp-reaction-info-row.is-mine .lp-reaction-info-cnt { color: #0656b0; }

.lp-chat-widget--dark .lp-reaction-info {
    background: #0f172a; border-color: #334155;
}
.lp-chat-widget--dark .lp-reaction-info-head {
    color: #94a3b8; border-bottom-color: #1e293b;
}
.lp-chat-widget--dark .lp-reaction-info-row { color: #e2e8f0; }
.lp-chat-widget--dark .lp-reaction-info-row:hover { background: #1e293b; }
.lp-chat-widget--dark .lp-reaction-info-row.is-mine { background: #064a96; }
.lp-chat-widget--dark .lp-reaction-info-row.is-mine:hover { background: #0656b0; }
.lp-chat-widget--dark .lp-reaction-info-names { color: #e2e8f0; }
.lp-chat-widget--dark .lp-reaction-info-cnt { color: #cbd5e1; }
.lp-chat-widget--dark .lp-reaction-info-row.is-mine .lp-reaction-info-cnt { color: #dbeafe; }

/* Quote-Snippet in Message (Reply-Kontext) */
.lp-msg-quote {
    display: flex; align-items: stretch; gap: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
    overflow: hidden;
    text-decoration: none;
    max-width: 420px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.lp-msg-quote:hover { background: #eff6ff; border-color: #bfdbfe; }
.lp-msg-quote-accent {
    width: 3px; flex-shrink: 0; background: #3399ff;
}
.lp-msg-quote-body {
    padding: 5px 10px; display: flex; flex-direction: column; gap: 1px;
    min-width: 0; flex: 1;
}
.lp-msg-quote-name {
    font-size: 11.5px; font-weight: 700; color: #0656b0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-msg-quote-text {
    font-size: 12px; color: #475569; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-msg-quote-file {
    font-size: 11px; color: #64748b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-msg-quote--deleted .lp-msg-quote-accent { background: #cbd5e1; }
.lp-msg-quote--deleted .lp-msg-quote-name   { color: #94a3b8; }
.lp-msg-quote--deleted .lp-msg-quote-text   { color: #94a3b8; font-style: italic; }

/* Highlight-Pulse beim Spring-zu-Original */
.lp-msg--highlight { animation: lp-msg-pulse 1.4s ease-out; }
@keyframes lp-msg-pulse {
    0%   { background: rgba(59,130,246,.18); }
    100% { background: transparent; }
}
.lp-msg-text {
    font-size: 13px; color: #374151; line-height: 1.5;
    word-break: break-word; white-space: pre-wrap;
}
.lp-msg--cont .lp-msg-text { color: #475569; }

/* Mention chips */
.lp-mention-chip {
    display: inline-flex; align-items: center; gap: 3px;
    background: #dbeafe; color: #0656b0;
    font-weight: 700; font-size: 12px;
    padding: 2px 9px 2px 7px;
    border-radius: 999px;
    border: 1.5px solid #bfdbfe;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    vertical-align: middle;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}
.lp-mention-chip::before {
    content: '@';
    font-size: 11px; opacity: .7;
}
.lp-mention-chip:hover {
    background: #bfdbfe; border-color: #93c5fd; color: #0656b0;
}
.lp-mention-chip--self {
    background: #dcfce7; color: #15803d;
    border-color: #bbf7d0;
}
.lp-mention-chip--self:hover { background: #bbf7d0; border-color: #86efac; color: #166534; }

/* Order card (inline in message) */
.lp-msg-order-card {
    display: flex; align-items: stretch; gap: 0;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; margin-top: 8px; overflow: hidden;
    cursor: pointer; transition: border-color .15s, box-shadow .15s;
    max-width: 340px; text-decoration: none; color: inherit;
}
.lp-msg-order-card:hover {
    border-color: #93c5fd; box-shadow: 0 2px 8px rgba(59,130,246,.12);
}
.lp-msg-order-card-accent {
    width: 4px; flex-shrink: 0; border-radius: 10px 0 0 10px;
}
.lp-msg-order-card-body {
    padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1;
}
.lp-msg-order-card-top {
    display: flex; align-items: center; gap: 7px;
}
.lp-msg-order-card-num {
    font-weight: 800; font-size: 13px; color: #0f172a; letter-spacing: -0.01em;
}
.lp-msg-order-card-status {
    font-size: 10px; padding: 1px 7px; border-radius: 4px; font-weight: 700;
    color: #fff; line-height: 1.5; white-space: nowrap;
}
.lp-msg-order-card-details {
    font-size: 11.5px; color: #64748b; display: flex; align-items: center; gap: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-msg-order-card-details svg { flex-shrink: 0; opacity: .5; }
.lp-msg-order-card-arrow {
    display: flex; align-items: center; justify-content: center;
    padding: 0 12px; color: #94a3b8; flex-shrink: 0;
    transition: color .15s;
}
.lp-msg-order-card:hover .lp-msg-order-card-arrow { color: #3399ff; }

/* Invitation card (inline in DM) */
/* ============================================================
   Projekt-/Aufgaben-Karte (Zuweisung aus dem Projekte-Modul)
   ============================================================ */
.lp-msg-proj-card {
    display: flex;
    align-items: stretch;
    background: #f5f9ff;
    border: 1px solid #d6e6fb;
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
    max-width: 360px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.lp-msg-proj-card:hover {
    border-color: #0783ff;
    box-shadow: 0 4px 14px rgba(7, 131, 255, .13);
    transform: translateY(-1px);
    color: inherit;
}
.lp-msg-proj-card.is-done { opacity: .68; }

.lp-msg-proj-accent { width: 4px; flex-shrink: 0; background: #0783ff; }
.lp-msg-proj-card.is-task .lp-msg-proj-accent { background: #16a34a; }
.lp-msg-proj-card.is-overdue .lp-msg-proj-accent { background: #dc2626; }

.lp-msg-proj-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.lp-msg-proj-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #0783ff;
}
.lp-msg-proj-card.is-task .lp-msg-proj-head { color: #16a34a; }

.lp-msg-proj-title {
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.3;
    color: #0f172a;
    word-break: break-word;
}
.lp-msg-proj-card.is-done .lp-msg-proj-title { text-decoration: line-through; }

.lp-msg-proj-sub { font-size: .75rem; color: #64748b; }

.lp-msg-proj-chips {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 3px;
    font-size: .73rem;
    color: #64748b;
}

.lp-msg-proj-prio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    font-size: .62rem;
    font-weight: 800;
    color: #fff;
}
.lp-msg-proj-prio.p-A { background: #dc2626; }
.lp-msg-proj-prio.p-B { background: #d97706; }
.lp-msg-proj-prio.p-C { background: #0783ff; }

.lp-msg-proj-due.is-late { color: #dc2626; font-weight: 700; }
.lp-msg-proj-done { color: #16a34a; font-weight: 600; }

.lp-msg-proj-chev { align-self: center; padding-right: 10px; color: #cbd5e1; font-size: .8rem; }
.lp-msg-proj-card:hover .lp-msg-proj-chev { color: #0783ff; }

html[data-theme="dark"] .lp-msg-proj-card {
    background: #16233a;
    border-color: #2b3f5c;
}
html[data-theme="dark"] .lp-msg-proj-title { color: #e2e8f0; }
html[data-theme="dark"] .lp-msg-proj-chev { color: #475569; }

.lp-msg-invite-card {
    display: flex; align-items: stretch; gap: 0;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 10px; margin-top: 8px; overflow: hidden;
    max-width: 340px;
}
.lp-msg-invite-card--err { background: #fef2f2; border-color: #fecaca; }
.lp-msg-invite-accent {
    width: 4px; flex-shrink: 0; background: #f59e0b;
}
.lp-msg-invite-body {
    padding: 10px 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1;
}
.lp-msg-invite-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: #b45309;
}
.lp-msg-invite-head i { font-size: 13px; }
.lp-msg-invite-title {
    font-weight: 700; font-size: 14px; color: #0f172a; line-height: 1.25;
    word-break: break-word;
}
.lp-msg-invite-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 12px; color: #475569;
}
.lp-msg-invite-loc { color: #64748b; }
.lp-msg-invite-from {
    font-size: 11.5px; color: #78716c; font-style: italic;
}
.lp-msg-invite-from:empty { display: none; }
.lp-msg-invite-actions {
    display: flex; gap: 6px; margin-top: 4px;
}
.lp-msg-invite-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 6px 10px; border-radius: 7px; font-size: 12px; font-weight: 700;
    border: 1px solid transparent; cursor: pointer; transition: background .12s, border-color .12s;
}
.lp-msg-invite-btn:disabled { opacity: .55; cursor: default; }
.lp-msg-invite-btn--accept {
    background: #16a34a; color: #fff; border-color: #15803d;
}
.lp-msg-invite-btn--accept:hover:not(:disabled) { background: #15803d; }
.lp-msg-invite-btn--reject {
    background: #fff; color: #b91c1c; border-color: #fecaca;
}
.lp-msg-invite-btn--reject:hover:not(:disabled) { background: #fef2f2; border-color: #fca5a5; }
.lp-msg-invite-status {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 4px; padding: 4px 8px; border-radius: 6px;
    font-size: 11.5px; font-weight: 700;
}
.lp-msg-invite-status--accepted { background: #dcfce7; color: #166534; }
.lp-msg-invite-status--rejected { background: #fee2e2; color: #991b1b; }
.lp-msg-invite-status--pending  { background: #fef3c7; color: #92400e; }

/* Inline order tag in text */
.lp-order-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 5px;
    padding: 1px 7px; font-size: 12px; font-weight: 600; color: #0656b0;
    cursor: pointer; text-decoration: none; transition: background .12s;
    vertical-align: baseline;
}
.lp-order-tag:hover { background: #dbeafe; }
.lp-order-tag svg { flex-shrink: 0; }

/* ── Auto-detected URL in chat messages ──────────────────── */
.lp-msg-link {
    color: #0656b0;
    text-decoration: underline;
    text-decoration-color: rgba(29, 78, 216, .35);
    text-underline-offset: 2px;
    word-break: break-all;
    transition: color .12s, text-decoration-color .12s;
}
.lp-msg-link:hover {
    color: #0656b0;
    text-decoration-color: #0656b0;
}

/* ── # Order autocomplete dropdown ───────────────────────── */
.lp-order-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; cursor: pointer; transition: background .1s;
}
.lp-order-item:hover, .lp-order-item--focused { background: #f0f7ff; }

/* ── Composer ────────────────────────────────────────────── */
.lp-cw-composer {
    border-top: 1px solid #e9eef3;
    flex-shrink: 0; background: #fdfdfe;
}
.lp-cw-composer-actions {
    display: flex; align-items: center; gap: 2px;
    padding: 6px 12px 4px;
    border-bottom: 1px solid #f0f4f8;
}
.lp-cw-action-btn {
    display: flex; align-items: center; gap: 4px;
    background: none; border: none; color: #64748b;
    font-size: 12px; padding: 4px 8px; border-radius: 5px;
    cursor: pointer; white-space: nowrap;
    transition: background .12s, color .12s;
}
.lp-cw-action-btn:hover { background: #f1f5f9; color: #1e293b; }

.lp-cw-composer-input {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px 9px;
    position: relative;
}
.lp-cw-attach-btn,
.lp-cw-emoji-btn {
    background: none; border: none; color: #b0bec5;
    cursor: pointer; padding: 4px; flex-shrink: 0;
    display: flex; align-items: center; border-radius: 4px;
    transition: color .12s, background .12s;
}
.lp-cw-attach-btn:hover,
.lp-cw-emoji-btn:hover { color: #64748b; }
.lp-cw-emoji-btn.is-active { color: #3399ff; background: #eff6ff; }

.lp-emoji-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 6px;
    z-index: 50;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e9eef3;
}
.lp-emoji-popover emoji-picker {
    --background: #fff;
    --border-radius: 14px;
    --border-color: #eef2f7;
    --input-border-radius: 9px;
    --input-border-color: #e2e8f0;
    --indicator-color: #3399ff;
    --button-active-background: #eff6ff;
    --button-hover-background: #f1f5f9;
    --num-columns: 9;
    --emoji-size: 1.4rem;
    --emoji-padding: 0.4rem;
    --category-emoji-size: 1.15rem;
    height: 380px;
    width: 360px;
    max-width: calc(100vw - 40px);
}

.lp-cw-input-wrap { flex: 1; min-width: 0; position: relative; }

#lp-chat-input {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 8px 12px; font-size: 13px; color: #1e293b;
    outline: none; background: #f8fafc;
    transition: border-color .15s, background .15s, box-shadow .15s, height .12s ease;
    font-family: inherit;
    line-height: 20px;
    resize: none;
    /* Explizite Start-Höhe: 20 (line-height) + 2*8 (padding) + 2*1.5 (border) = 39px */
    height: 39px;
    max-height: 140px;
    overflow-y: auto;
    display: block;
    vertical-align: middle;
}
#lp-chat-input:focus {
    border-color: #0783ff; background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
#lp-chat-input::placeholder { color: #b0bec5; }

.lp-cw-send-btn {
    display: flex; align-items: center; gap: 5px;
    background: #0783ff; color: #fff; border: none;
    border-radius: 10px; padding: 8px 13px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
    transition: background .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.lp-cw-send-btn:hover { background: #0656b0; box-shadow: 0 3px 8px rgba(37,99,235,.4); }
.lp-cw-send-btn:active { transform: scale(.97); }
.lp-cw-send-btn:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }

/* Readonly */
.lp-cw-readonly {
    padding: 11px 14px; font-size: 12.5px; color: #64748b;
    display: flex; align-items: center; gap: 7px;
    border-top: 1px solid #e9eef3; background: #f8fafc; flex-shrink: 0;
}

/* Reconnect */
.lp-cw-reconnect {
    background: #fef3c7; color: #92400e;
    font-size: 11.5px; text-align: center; padding: 5px; flex-shrink: 0;
}

/* ── @ Mention dropdown ──────────────────────────────────── */
.lp-mention-dropdown {
    position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
    z-index: 9200; max-height: 200px; overflow-y: auto; padding: 4px 0;
}
.lp-mention-dropdown::-webkit-scrollbar { width: 3px; }
.lp-mention-dropdown::-webkit-scrollbar-thumb { background: #e2e8f0; }

.lp-mention-item {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 12px; cursor: pointer; transition: background .1s;
}
.lp-mention-item:hover, .lp-mention-item--focused { background: #f0f7ff; }

.lp-mention-av {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 9.5px; font-weight: 700; color: #fff; overflow: hidden;
    flex-shrink: 0; position: relative;
}
.lp-mention-av img { width: 100%; height: 100%; object-fit: cover; }
.lp-mention-name { font-size: 13px; color: #1e293b; font-weight: 500; flex: 1; }

/* ── Employee Picker ─────────────────────────────────────── */
.lp-empicker-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.4);
    z-index: 9200; display: flex; align-items: center; justify-content: center;
}
.lp-empicker-modal {
    background: #fff; border-radius: 14px;
    width: 380px; max-width: calc(100vw - 40px); max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 16px 60px rgba(0,0,0,.2); overflow: hidden;
}
.lp-empicker-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 18px; border-bottom: 1px solid #e9eef3;
    font-size: 14.5px; font-weight: 700; color: #0f172a;
}
.lp-empicker-search-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-bottom: 1px solid #e9eef3; color: #b0bec5;
}
.lp-empicker-search-wrap input {
    flex: 1; border: none; outline: none;
    font-size: 13.5px; color: #1e293b; background: none;
}
.lp-empicker-search-wrap input::placeholder { color: #b0bec5; }
.lp-empicker-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.lp-empicker-list::-webkit-scrollbar { width: 4px; }
.lp-empicker-list::-webkit-scrollbar-thumb { background: #e2e8f0; }

.lp-empicker-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 16px; cursor: pointer; transition: background .1s;
}
.lp-empicker-item:hover { background: #f8fafc; }

.lp-empicker-av {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700; color: #fff; overflow: hidden;
    flex-shrink: 0; position: relative;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.lp-empicker-av img { width: 100%; height: 100%; object-fit: cover; }
.lp-empicker-av .lp-status-dot { border-color: #fff; }

.lp-empicker-info { flex: 1; min-width: 0; }
.lp-empicker-name { font-size: 13.5px; font-weight: 600; color: #1e293b; }
.lp-empicker-status { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }
.lp-empicker-status--online { color: #16a34a; font-weight: 500; }
.lp-empicker-status--pause  { color: #d97706; font-weight: 500; }

/* ── Manage modal ────────────────────────────────────────── */
.lp-manage-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.4);
    z-index: 9200; display: flex; align-items: center; justify-content: center;
}
.lp-manage-modal {
    background: #fff; border-radius: 14px;
    width: 620px; max-width: calc(100vw - 40px); max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 16px 60px rgba(0,0,0,.2); overflow: hidden;
}
.lp-manage-modal__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #e9eef3;
    font-size: 15px; font-weight: 700; color: #0f172a;
}
.lp-manage-close {
    background: none; border: none; color: #64748b; cursor: pointer;
    padding: 5px; border-radius: 6px; display: flex; align-items: center;
    transition: background .12s;
}
.lp-manage-close:hover { background: #f1f5f9; color: #1e293b; }
.lp-manage-modal__body {
    flex: 1; overflow-y: auto; padding: 18px 20px;
    display: flex; flex-direction: column; gap: 16px;
}
.lp-manage-modal__body h4 {
    font-size: 11.5px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px;
}
.lp-manage-new-form {
    background: #f8fafc; border-radius: 10px; padding: 16px;
    border: 1px solid #e9eef3;
}
.lp-manage-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lp-manage-form-row input[type="text"],
.lp-manage-form-row select {
    height: 36px; border: 1.5px solid #e2e8f0; border-radius: 8px;
    padding: 0 10px; font-size: 13px; color: #1e293b;
    background: #fff; outline: none; transition: border-color .15s;
}
.lp-manage-form-row input[type="text"] { flex: 1; min-width: 120px; }
.lp-manage-form-row input:focus,
.lp-manage-form-row select:focus { border-color: #0783ff; }
.lp-manage-btn {
    height: 36px; padding: 0 14px; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer; border: none;
    transition: background .15s;
}
.lp-manage-btn--primary { background: #0783ff; color: #fff; }
.lp-manage-btn--primary:hover { background: #0656b0; }
.lp-manage-btn--danger  { background: #fee2e2; color: #dc2626; }
.lp-manage-btn--danger:hover { background: #fecaca; }
.lp-manage-btn--ghost   { background: #f1f5f9; color: #334155; }
.lp-manage-btn--ghost:hover { background: #e2e8f0; }
.lp-manage-list { display: flex; flex-direction: column; gap: 6px; }
.lp-manage-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: #f8fafc;
    border: 1px solid #e9eef3; border-radius: 9px; flex-wrap: wrap;
}
.lp-manage-row__name { flex: 1; font-size: 13.5px; font-weight: 600; color: #1e293b; }
.lp-manage-row__meta { font-size: 11.5px; color: #94a3b8; }
.lp-manage-row__actions { display: flex; gap: 5px; }
.lp-manage-row--archived { opacity: .5; }

/* ── Manage: create form ───────────────────────────────── */
.lp-manage-create-grid { display: flex; flex-direction: column; gap: 10px; }
.lp-manage-input {
    height: 36px; border: 1.5px solid #e2e8f0; border-radius: 8px;
    padding: 0 10px; font-size: 13px; color: #1e293b;
    background: #fff; outline: none; transition: border-color .15s;
}
.lp-manage-input:focus { border-color: #0783ff; }
.lp-manage-input--search { flex: 1; min-width: 0; }
.lp-manage-select {
    height: 36px; border: 1.5px solid #e2e8f0; border-radius: 8px;
    padding: 0 8px; font-size: 13px; color: #1e293b;
    background: #fff; outline: none;
}
.lp-manage-select:focus { border-color: #0783ff; }
.lp-manage-select--full { width: 100%; }
.lp-manage-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lp-manage-label { font-size: 11px; color: #64748b; }
.lp-manage-btn--create { align-self: flex-end; }

/* ── Member section (create + edit) ─────────────────────── */
.lp-manage-member-section { display: flex; flex-direction: column; gap: 6px; }
.lp-manage-member-bar { display: flex; gap: 6px; align-items: center; }
.lp-manage-emp-results {
    max-height: 160px; overflow-y: auto; border: 1px solid #e2e8f0;
    border-radius: 8px; background: #fff;
}
.lp-manage-emp-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    cursor: pointer; font-size: 13px; color: #1e293b;
    transition: background .1s;
}
.lp-manage-emp-item:hover { background: #f1f5f9; }
.lp-manage-emp-item__av {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.lp-manage-emp-item__name { flex: 1; }
.lp-manage-selected-chips {
    display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px;
}
.lp-manage-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #e0e7ff; color: #3730a3; border-radius: 12px;
    padding: 3px 8px 3px 10px; font-size: 11.5px; font-weight: 500;
}
.lp-manage-chip__x {
    background: none; border: none; cursor: pointer;
    color: #6366f1; font-size: 13px; line-height: 1;
    padding: 0 1px; font-weight: 700;
}
.lp-manage-chip__x:hover { color: #dc2626; }

/* ── Edit panel (member list with toggles) ──────────────── */
.lp-manage-edit-panel {
    width: 100%; margin-top: 10px; padding: 12px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    display: flex; flex-direction: column; gap: 10px;
}
.lp-manage-edit-panel__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lp-manage-edit-panel__row .lp-manage-input { flex: 1; min-width: 120px; }
.lp-manage-members-hdr {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 4px;
}
.lp-manage-members-hdr span { font-size: 11.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.lp-manage-member-list {
    max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.lp-manage-member-row {
    display: flex; align-items: center; gap: 8px; padding: 5px 8px;
    border-radius: 6px; font-size: 13px;
}
.lp-manage-member-row:hover { background: #f8fafc; }
.lp-manage-member-row__av {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.lp-manage-member-row__name { flex: 1; color: #1e293b; }
.lp-manage-member-row__write {
    font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 4px;
}
.lp-manage-member-row__rm {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 15px; padding: 0 3px; transition: color .12s;
}
.lp-manage-member-row__rm:hover { color: #ef4444; }
.lp-manage-dept-bar { display: flex; gap: 6px; align-items: center; }

/* ── Avatar colors ───────────────────────────────────────── */
.lp-av-0 { background: #0783ff; }
.lp-av-1 { background: #7c3aed; }
.lp-av-2 { background: #db2777; }
.lp-av-3 { background: #059669; }
.lp-av-4 { background: #d97706; }
.lp-av-5 { background: #0891b2; }
.lp-av-6 { background: #9333ea; }
.lp-av-7 { background: #16a34a; }

/* ── File upload preview bar ─────────────────────────────── */
.lp-cw-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
    font-size: 12px;
    color: #0369a1;
    font-weight: 600;
}
.lp-cw-file-preview-icon { display: flex; align-items: center; color: #0284c7; }
.lp-cw-file-preview-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-cw-file-preview-size { color: #64748b; font-weight: 500; }
.lp-cw-file-preview-spinner {
    width: 14px; height: 14px;
    border: 2px solid #93c5fd;
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: lp-spin .6s linear infinite;
}
@keyframes lp-spin { to { transform: rotate(360deg); } }

.lp-cw-file-preview-remove {
    background: none; border: none; cursor: pointer;
    color: #0369a1; padding: 2px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.lp-cw-file-preview-remove:hover { background: #e0f2fe; color: #b91c1c; }
.lp-cw-file-preview.is-ready { background: #ecfdf5; border-bottom-color: #a7f3d0; color: #065f46; }
.lp-cw-file-preview.is-ready .lp-cw-file-preview-icon { color: #059669; }
.lp-cw-file-preview.is-ready .lp-cw-file-preview-remove { color: #065f46; }
.lp-cw-file-preview.is-ready .lp-cw-file-preview-remove:hover { background: #d1fae5; color: #b91c1c; }

/* ── Reply preview bar (über Composer) ──────────────────── */
.lp-cw-reply-preview {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    position: relative;
    overflow: hidden;
    animation: lp-reply-slide-in .18s ease-out;
}
@keyframes lp-reply-slide-in {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}
.lp-cw-reply-preview-accent {
    width: 3px; flex-shrink: 0; background: #0783ff;
}
.lp-cw-reply-preview-icon {
    display: flex; align-items: center; justify-content: center;
    padding: 0 10px; color: #0783ff; flex-shrink: 0;
}
.lp-cw-reply-preview-text {
    flex: 1; min-width: 0; padding: 7px 0;
    display: flex; flex-direction: column; gap: 1px;
}
.lp-cw-reply-preview-name {
    font-size: 11.5px; font-weight: 700; color: #0656b0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-cw-reply-preview-content {
    font-size: 12px; color: #475569; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-cw-reply-preview-remove {
    background: none; border: none; cursor: pointer;
    color: #0656b0; padding: 0 10px;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.lp-cw-reply-preview-remove:hover { background: #dbeafe; color: #b91c1c; }

/* ── File in message ────────────────────────────────────── */
.lp-msg-file {
    margin-top: 4px;
    max-width: 320px;
}
.lp-msg-file-img-wrap {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}
.lp-msg-file-img {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}
.lp-msg-file-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
}
.lp-msg-file-name {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #0284c7;
    text-decoration: none;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lp-msg-file-name:hover { text-decoration: underline; }
.lp-msg-file-size {
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}
.lp-msg-file-dl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 6px;
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
    transition: all .12s;
}
.lp-msg-file-dl:hover {
    color: #0284c7;
    border-color: #93c5fd;
    background: #f0f9ff;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
    .lp-chat-widget { width: calc(100vw - 20px); right: 10px; bottom: 16px; height: 72vh; }
    .lp-cw-sidebar  { min-width: 175px; width: 175px; }
}

/* ╔══════════════════════════════════════════════════════════╗
   ║  DARKMODE                                                ║
   ╚══════════════════════════════════════════════════════════╝ */
.lp-chat-widget--dark {
    background: #0f172a;
    border-color: #1e293b;
    color: #e2e8f0;
}
.lp-chat-widget--dark .lp-cw-tabs,
.lp-chat-widget--dark .lp-cw-search,
.lp-chat-widget--dark .lp-cw-sidebar { background: #0b1220; border-color: #1e293b; }
.lp-chat-widget--dark .lp-cw-tab { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-tab:hover { color: #e2e8f0; }
.lp-chat-widget--dark .lp-cw-tab--active { color: #60a5fa; border-bottom-color: #60a5fa; }
.lp-chat-widget--dark .lp-cw-tab--active svg { color: #60a5fa; }

.lp-chat-widget--dark .lp-cw-search input { color: #e2e8f0; }
.lp-chat-widget--dark .lp-cw-search input::placeholder { color: #64748b; }

.lp-chat-widget--dark .lp-cw-chan-item:hover { background: #172033; }
.lp-chat-widget--dark .lp-cw-chan-item--active { background: #1e293b; }
.lp-chat-widget--dark .lp-cw-ci-name { color: #f1f5f9; }
.lp-chat-widget--dark .lp-cw-ci-time,
.lp-chat-widget--dark .lp-cw-ci-preview { color: #94a3b8; }

.lp-chat-widget--dark .lp-cw-pane,
.lp-chat-widget--dark .lp-cw-pane-header { background: #0f172a; border-color: #1e293b; }
.lp-chat-widget--dark .lp-cw-pane-title { color: #f1f5f9; }

/* Dark: In-Chat-Suche */
.lp-chat-widget--dark .lp-cw-msgsearch-btn { background: #1e293b; color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-msgsearch-btn:hover { background: #334155; color: #f1f5f9; }
.lp-chat-widget--dark .lp-cw-msgsearch-btn.is-active { background: #0656b0; color: #fff; }
.lp-chat-widget--dark .lp-cw-msgsearch { background: #0f172a; border-color: #1e293b; }
.lp-chat-widget--dark #lp-msgsearch-input { color: #f1f5f9; }
.lp-chat-widget--dark .lp-cw-msgsearch-nav:hover:not(:disabled),
.lp-chat-widget--dark .lp-cw-msgsearch-close:hover { background: #1e293b; color: #f1f5f9; }
.lp-chat-widget--dark .lp-cw-msgsearch-results { border-color: #1e293b; }
.lp-chat-widget--dark .lp-cw-msgsearch-item { border-color: #172033; }
.lp-chat-widget--dark .lp-cw-msgsearch-item:hover { background: #172033; }
.lp-chat-widget--dark .lp-cw-msgsearch-item.is-active { background: #1e293b; }
.lp-chat-widget--dark .lp-cw-msgsearch-item__sender { color: #cbd5e1; }
.lp-chat-widget--dark .lp-cw-msgsearch-item__text { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-msgsearch-item__text mark { background: #a16207; color: #fef3c7; }
.lp-chat-widget--dark .lp-emoji-popover { background: #0f172a; border-color: #1e293b; }
.lp-chat-widget--dark .lp-manage-section-head { border-color: #1e293b; color: #64748b; }
.lp-chat-widget--dark .lp-manage-section-count { background: #1e293b; color: #94a3b8; }

.lp-chat-widget--dark .lp-cw-messages { background: #0f172a; }
.lp-chat-widget--dark .lp-cw-scrolldown {
    background: rgba(30, 41, 59, 0.92); border-color: #334155; color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.lp-chat-widget--dark .lp-cw-scrolldown:hover { color: #60a5fa; border-color: #3399ff; }
.lp-chat-widget--dark .lp-cw-empty { color: #64748b; }
.lp-chat-widget--dark .lp-msg:hover { background: #172033; }
.lp-chat-widget--dark .lp-msg-name { color: #f1f5f9; }
.lp-chat-widget--dark .lp-msg-time { color: #64748b; }
.lp-chat-widget--dark .lp-msg-text { color: #cbd5e1; }
.lp-chat-widget--dark .lp-msg-cont-time { color: #475569; }
.lp-chat-widget--dark .lp-msg--cont:hover .lp-msg-cont-time { color: #94a3b8; }
.lp-chat-widget--dark .lp-msg--gapped .lp-msg-cont-time { color: #60a5fa; }
.lp-chat-widget--dark .lp-msg--gapped::before {
    background: linear-gradient(to right, transparent, #1e293b 12%, #1e293b 88%, transparent);
}
.lp-chat-widget--dark .lp-msg-divider::before,
.lp-chat-widget--dark .lp-msg-divider::after { background: #1e293b; }
.lp-chat-widget--dark .lp-msg-divider__label {
    background: #1e293b; color: #94a3b8; border-color: #334155;
}

.lp-chat-widget--dark .lp-msg-unread-divider__label {
    background: #2a0f0f; color: #fca5a5; border-color: #7f1d1d;
}

.lp-chat-widget--dark .lp-cw-composer { background: #0b1220; border-color: #1e293b; }
.lp-chat-widget--dark .lp-cw-composer-actions { border-color: #1e293b; }
.lp-chat-widget--dark .lp-cw-action-btn { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-action-btn:hover { background: #172033; color: #e2e8f0; }
.lp-chat-widget--dark #lp-chat-input {
    background: #172033; border-color: #1e293b; color: #f1f5f9;
}
.lp-chat-widget--dark #lp-chat-input:focus {
    background: #1e293b; border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96,165,250,.18);
}
.lp-chat-widget--dark #lp-chat-input::placeholder { color: #64748b; }
.lp-chat-widget--dark .lp-cw-attach-btn,
.lp-chat-widget--dark .lp-cw-emoji-btn { color: #64748b; }
.lp-chat-widget--dark .lp-cw-attach-btn:hover,
.lp-chat-widget--dark .lp-cw-emoji-btn:hover { color: #cbd5e1; }

.lp-chat-widget--dark .lp-cw-readonly { background: #0b1220; color: #94a3b8; border-color: #1e293b; }

.lp-chat-widget--dark .lp-msg-file-info {
    background: #172033; border-color: #1e293b;
}
.lp-chat-widget--dark .lp-msg-file-name { color: #60a5fa; }
.lp-chat-widget--dark .lp-msg-file-size { color: #64748b; }
.lp-chat-widget--dark .lp-msg-file-dl {
    background: #0f172a; border-color: #1e293b; color: #94a3b8;
}
.lp-chat-widget--dark .lp-msg-file-dl:hover {
    background: #1e293b; color: #60a5fa; border-color: #334155;
}

/* Mention/order dropdowns */
.lp-chat-widget--dark .lp-mention-dropdown {
    background: #1e293b; border-color: #334155;
}
.lp-chat-widget--dark .lp-mention-item:hover,
.lp-chat-widget--dark .lp-mention-item--focused { background: #172033; }
.lp-chat-widget--dark .lp-mention-name { color: #f1f5f9; }

/* Settings view in dark */
.lp-chat-widget--dark .lp-cw-settings-view { background: #0f172a; }
.lp-chat-widget--dark .lp-cw-settings-header {
    background: #0b1220; border-color: #1e293b;
}
.lp-chat-widget--dark .lp-cw-settings-header h3 { color: #f1f5f9; }
.lp-chat-widget--dark .lp-cw-settings-back { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-settings-back:hover { background: #172033; color: #e2e8f0; }
.lp-chat-widget--dark .lp-cw-settings-section-title { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-settings-row {
    background: #172033; border-color: #1e293b;
}
.lp-chat-widget--dark .lp-cw-settings-row-label { color: #f1f5f9; }
.lp-chat-widget--dark .lp-cw-settings-row-desc { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-switch-slider { background: #334155; }

.lp-chat-widget--dark .lp-cw-new-dm {
    background: #0b1220; border-color: #334155; color: #94a3b8;
}
.lp-chat-widget--dark .lp-cw-new-dm:hover { background: #172033; color: #60a5fa; border-color: #60a5fa; }

.lp-chat-widget--dark .lp-cw-file-preview {
    background: #0c1d2b; color: #7dd3fc; border-color: #155e75;
}
.lp-chat-widget--dark .lp-cw-file-preview-icon { color: #38bdf8; }
.lp-chat-widget--dark .lp-cw-file-preview-size { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-file-preview-remove { color: #7dd3fc; }
.lp-chat-widget--dark .lp-cw-file-preview.is-ready {
    background: #0c2418; color: #6ee7b7; border-color: #14532d;
}
.lp-chat-widget--dark .lp-cw-file-preview.is-ready .lp-cw-file-preview-icon { color: #34d399; }

/* Dark: Reply-Preview + Quote + Hover-Actions */
.lp-chat-widget--dark .lp-cw-reply-preview {
    background: #0c1d2b; border-bottom-color: #1e3a5f;
}
.lp-chat-widget--dark .lp-cw-reply-preview-name    { color: #60a5fa; }
.lp-chat-widget--dark .lp-cw-reply-preview-content { color: #94a3b8; }
.lp-chat-widget--dark .lp-cw-reply-preview-icon    { color: #60a5fa; }
.lp-chat-widget--dark .lp-cw-reply-preview-remove  { color: #60a5fa; }
.lp-chat-widget--dark .lp-cw-reply-preview-remove:hover { background: #1e293b; color: #fca5a5; }

.lp-chat-widget--dark .lp-msg-quote {
    background: #172033; border-color: #1e293b;
}
.lp-chat-widget--dark .lp-msg-quote:hover {
    background: #1e293b; border-color: #334155;
}
.lp-chat-widget--dark .lp-msg-quote-name { color: #60a5fa; }
.lp-chat-widget--dark .lp-msg-quote-text { color: #94a3b8; }
.lp-chat-widget--dark .lp-msg-quote-file { color: #64748b; }
.lp-chat-widget--dark .lp-msg-quote--deleted .lp-msg-quote-accent { background: #334155; }
.lp-chat-widget--dark .lp-msg-quote--deleted .lp-msg-quote-name   { color: #64748b; }
.lp-chat-widget--dark .lp-msg-quote--deleted .lp-msg-quote-text   { color: #64748b; }

.lp-chat-widget--dark .lp-msg-actions {
    background: #1e293b; border-color: #334155;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.lp-chat-widget--dark .lp-msg-action { color: #64748b; }
.lp-chat-widget--dark .lp-msg-action--reply:hover  { color: #60a5fa; background: #172033; }
.lp-chat-widget--dark .lp-msg-action--reply-private:hover { color: #34d399; background: #0f2218; }
.lp-chat-widget--dark .lp-msg-action--delete:hover { color: #f87171; background: #2a0f0f; }

/* ── Privat-Antworten Button (Hell) ─────────────────────── */
.lp-msg-action--reply-private:hover { color: #059669; background: #ecfdf5; }

/* ── Read-Receipts (WhatsApp-style, bottom-right) ───────── */
.lp-msg-receipt {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: -2px;
    color: #9ca3af;
    cursor: default;
    user-select: none;
    transition: color .18s ease;
    line-height: 1;
}
.lp-msg-receipt-icon {
    flex: 0 0 auto;
    display: block;
    transition: color .18s ease;
}
.lp-msg-receipt--read { color: #60a5fa; }
.lp-msg-receipt--full { color: #3399ff; }
.lp-msg-receipt[data-recipient-count]:not([data-recipient-count="1"]):not([data-recipient-count="0"]) {
    cursor: pointer;
}
.lp-msg-receipt[data-recipient-count]:not([data-recipient-count="1"]):not([data-recipient-count="0"]):hover {
    color: #0783ff;
}

.lp-chat-widget--dark .lp-msg-receipt { color: #64748b; }
.lp-chat-widget--dark .lp-msg-receipt--read { color: #60a5fa; }
.lp-chat-widget--dark .lp-msg-receipt--full { color: #3399ff; }

/* Lesestatus per User-Setting komplett ausblenden */
.lp-chat-widget--no-receipts .lp-msg-receipt { display: none !important; }

/* ── Readers-Popover ────────────────────────────────────── */
.lp-msg-readers-pop {
    position: fixed;
    width: 240px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15,23,42,.18);
    padding: 8px 0;
    z-index: 10000;
    font-size: 13px;
}
.lp-msg-readers-head {
    padding: 4px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}
.lp-msg-readers-list { display: flex; flex-direction: column; }
.lp-msg-readers-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
}
.lp-msg-readers-item:hover { background: #f8fafc; }
.lp-msg-readers-av {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    background: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}
.lp-msg-readers-av--initials { background: #6366f1; }
.lp-msg-readers-name { color: #1e293b; }
.lp-msg-readers-loading, .lp-msg-readers-empty {
    padding: 12px; text-align: center;
    font-size: 12px; color: #94a3b8;
}

.lp-chat-widget--dark ~ .lp-msg-readers-pop,
body.lp-chat-dark .lp-msg-readers-pop,
.lp-chat-widget--dark .lp-msg-readers-pop {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.lp-chat-widget--dark ~ .lp-msg-readers-pop .lp-msg-readers-name,
body.lp-chat-dark .lp-msg-readers-pop .lp-msg-readers-name,
.lp-chat-widget--dark .lp-msg-readers-pop .lp-msg-readers-name { color: #f1f5f9; }
.lp-chat-widget--dark ~ .lp-msg-readers-pop .lp-msg-readers-head,
body.lp-chat-dark .lp-msg-readers-pop .lp-msg-readers-head,
.lp-chat-widget--dark .lp-msg-readers-pop .lp-msg-readers-head {
    color: #94a3b8;
    border-bottom-color: #334155;
}
.lp-chat-widget--dark ~ .lp-msg-readers-pop .lp-msg-readers-loading,
body.lp-chat-dark .lp-msg-readers-pop .lp-msg-readers-loading,
.lp-chat-widget--dark .lp-msg-readers-pop .lp-msg-readers-loading,
.lp-chat-widget--dark ~ .lp-msg-readers-pop .lp-msg-readers-empty,
body.lp-chat-dark .lp-msg-readers-pop .lp-msg-readers-empty,
.lp-chat-widget--dark .lp-msg-readers-pop .lp-msg-readers-empty { color: #94a3b8; }
.lp-chat-widget--dark ~ .lp-msg-readers-pop .lp-msg-readers-item:hover,
body.lp-chat-dark .lp-msg-readers-pop .lp-msg-readers-item:hover,
.lp-chat-widget--dark .lp-msg-readers-pop .lp-msg-readers-item:hover { background: #334155; }

/* ── Cross-Channel Reply-Quote ──────────────────────────── */
.lp-msg-quote--cross { cursor: pointer; }
.lp-msg-quote--cross:hover .lp-msg-quote-accent { background: #0783ff; }
.lp-msg-quote-hint {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    background: #1e293b;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    animation: lpFadeIn .15s ease-out;
    z-index: 10;
}
.lp-msg-quote { position: relative; }
@keyframes lpFadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   Abstimmungen (Polls)
   ════════════════════════════════════════════════════════════ */
.lp-poll-card {
    margin-top: 6px; padding: 11px 12px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-left: 3px solid #6366f1;
    border-radius: 10px; max-width: 320px;
}
.lp-chat-widget--dark .lp-poll-card { background: #0f172a; border-color: #334155; border-left-color: #818cf8; }
.lp-poll-head { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.lp-poll-q { font-weight: 700; font-size: 13.5px; color: #1e293b; line-height: 1.3; }
.lp-chat-widget--dark .lp-poll-q { color: #f1f5f9; }
.lp-poll-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lp-poll-tag {
    font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
    background: #e0e7ff; color: #4338ca;
}
.lp-poll-tag--closed { background: #fee2e2; color: #b91c1c; }
.lp-chat-widget--dark .lp-poll-tag { background: #312e81; color: #c7d2fe; }
.lp-chat-widget--dark .lp-poll-tag--closed { background: #4c1d1d; color: #fca5a5; }

/* Abstimm-Modus */
.lp-poll-opts { display: flex; flex-direction: column; gap: 4px; }
.lp-poll-opt {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 7px 9px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; color: #1e293b; background: #fff; transition: background .12s, border-color .12s;
}
.lp-poll-opt:hover { background: #eef2ff; border-color: #c7d2fe; }
.lp-poll-opt input { accent-color: #6366f1; }
.lp-chat-widget--dark .lp-poll-opt { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.lp-chat-widget--dark .lp-poll-opt:hover { background: #28344a; }
.lp-poll-vote-btn {
    margin-top: 8px; width: 100%; padding: 7px; border: none; border-radius: 8px;
    background: #6366f1; color: #fff; font-weight: 600; font-size: 13px; cursor: pointer;
}
.lp-poll-vote-btn:hover { background: #4f46e5; }

/* Ergebnis-Modus */
.lp-poll-results { display: flex; flex-direction: column; gap: 5px; }
.lp-poll-res { position: relative; border-radius: 8px; overflow: hidden; background: #eef2f7; min-height: 30px; }
.lp-chat-widget--dark .lp-poll-res { background: #1e293b; }
.lp-poll-res-bar {
    position: absolute; left: 0; top: 0; bottom: 0; width: 0;
    background: #c7d2fe; transition: width .4s ease;
}
.lp-chat-widget--dark .lp-poll-res-bar { background: #3730a3; }
.lp-poll-res--mine .lp-poll-res-bar { background: #a5b4fc; }
.lp-chat-widget--dark .lp-poll-res--mine .lp-poll-res-bar { background: #4f46e5; }
.lp-poll-res-lbl {
    position: relative; display: flex; justify-content: space-between; align-items: center;
    gap: 8px; padding: 6px 10px; font-size: 12.5px; color: #1e293b;
}
.lp-chat-widget--dark .lp-poll-res-lbl { color: #e2e8f0; }
.lp-poll-res--mine .lp-poll-res-txt { font-weight: 700; }
.lp-poll-res-cnt { font-weight: 600; color: #475569; white-space: nowrap; }
.lp-chat-widget--dark .lp-poll-res-cnt { color: #94a3b8; }
.lp-poll-foot { margin-top: 7px; font-size: 11px; color: #64748b; }
.lp-poll-foot-closes { color: #94a3b8; }
.lp-poll-actions { margin-top: 6px; display: flex; gap: 12px; }
.lp-poll-link {
    background: none; border: none; padding: 0; cursor: pointer;
    color: #6366f1; font-size: 12px; font-weight: 600;
}
.lp-poll-link:hover { text-decoration: underline; }
.lp-poll-link--danger { color: #ef4444; }

/* Poll-Erstell-Modal */
.lp-poll-modal {
    position: absolute; inset: 0; z-index: 9400;
    background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center;
    padding: 14px; border-radius: 16px;
}
.lp-poll-modal-card {
    width: 100%; max-width: 340px; max-height: 92%; overflow-y: auto;
    background: #fff; border-radius: 14px; box-shadow: 0 16px 50px rgba(0,0,0,.35);
    display: flex; flex-direction: column;
}
.lp-chat-widget--dark .lp-poll-modal-card { background: #1e293b; color: #e2e8f0; }
.lp-poll-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 15px; font-weight: 700; font-size: 14px; color: #1e293b;
    border-bottom: 1px solid #eef2f7;
}
.lp-chat-widget--dark .lp-poll-modal-head { color: #f1f5f9; border-color: #334155; }
.lp-poll-modal-x { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #94a3b8; }
.lp-poll-modal-body { padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; }
.lp-poll-lbl { font-size: 11.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }
.lp-chat-widget--dark .lp-poll-lbl { color: #94a3b8; }
.lp-poll-input {
    width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 13px; color: #1e293b; background: #fff;
}
.lp-chat-widget--dark .lp-poll-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
.lp-poll-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.18); }
.lp-poll-optrow { display: flex; gap: 6px; margin-bottom: 5px; }
.lp-poll-optrm {
    flex-shrink: 0; width: 30px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc;
    color: #94a3b8; font-size: 17px; cursor: pointer;
}
.lp-poll-optrm:hover { color: #ef4444; border-color: #fca5a5; }
.lp-chat-widget--dark .lp-poll-optrm { background: #0f172a; border-color: #334155; }
.lp-poll-addopt {
    align-self: flex-start; background: none; border: none; color: #6366f1;
    font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 2px 0;
}
.lp-poll-settings { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lp-poll-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #334155; cursor: pointer; }
.lp-chat-widget--dark .lp-poll-check { color: #cbd5e1; }
.lp-poll-check input[type=checkbox] { accent-color: #6366f1; }
.lp-poll-check--date { justify-content: space-between; }
.lp-poll-check--date input { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 12px; }
.lp-chat-widget--dark .lp-poll-check--date input { background: #0f172a; border-color: #334155; color: #f1f5f9; color-scheme: dark; }
.lp-poll-err { color: #ef4444; font-size: 12px; font-weight: 600; }
.lp-poll-modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 15px; border-top: 1px solid #eef2f7;
}
.lp-chat-widget--dark .lp-poll-modal-foot { border-color: #334155; }
.lp-poll-btn { padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.lp-poll-btn--ghost { background: #f1f5f9; color: #475569; }
.lp-chat-widget--dark .lp-poll-btn--ghost { background: #334155; color: #e2e8f0; }
.lp-poll-btn--primary { background: #6366f1; color: #fff; }
.lp-poll-btn--primary:hover { background: #4f46e5; }

/* ════════════════════════════════════════════════════════════
   Anstups / Nudge
   ════════════════════════════════════════════════════════════ */
.lp-cw-nudge-btn.lp-nudge-l1 { color: #ca8a04; }
.lp-cw-nudge-btn.lp-nudge-l2 { color: #ea580c; }
.lp-cw-nudge-btn.lp-nudge-l3 { color: #dc2626; }
.lp-cw-nudge-btn:disabled { opacity: .65; cursor: default; }

/* Hervorgehobener Chat (Empfänger-Sicht) */
.lp-nudge-hl-1 { box-shadow: inset 3px 0 0 #facc15; }
.lp-nudge-hl-2 { box-shadow: inset 3px 0 0 #f97316; background: rgba(249,115,22,.06); }
.lp-nudge-hl-3 { box-shadow: inset 3px 0 0 #ef4444; background: rgba(239,68,68,.09); animation: lpNudgePulse 1.3s ease-in-out infinite; }
@keyframes lpNudgePulse { 0%,100% { background: rgba(239,68,68,.05); } 50% { background: rgba(239,68,68,.16); } }

/* Nudge-Toast */
.lp-nudge-toast {
    position: fixed; right: 22px; bottom: 96px; z-index: 99999;
    display: flex; align-items: center; gap: 11px;
    min-width: 240px; max-width: 340px; padding: 12px 14px;
    background: #fff; border-radius: 12px; border-left: 5px solid #facc15;
    box-shadow: 0 12px 34px rgba(0,0,0,.25); cursor: pointer;
    transform: translateX(120%); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.lp-nudge-toast.show { transform: translateX(0); opacity: 1; }
.lp-nudge-toast--2 { border-left-color: #f97316; }
.lp-nudge-toast--3 { border-left-color: #ef4444; }
.lp-nudge-toast-ico { font-size: 22px; flex-shrink: 0; }
.lp-nudge-toast-body { font-size: 13px; color: #1e293b; line-height: 1.35; }
.lp-nudge-toast--3 .lp-nudge-toast-body b { color: #dc2626; }
