/* ── RoomFlow OS v25 — Chat panel ── */
/* ══════════════════════════════════════
   CHAT PANEL
   ══════════════════════════════════════ */
.chat-panel {
    position: fixed; bottom: 0; right: 0; z-index: 1200;
    width: min(360px,100vw); height: min(520px,85vh);
    background: var(--surface);
    border: var(--glass-border);
    border-top: none;
    border-radius: var(--r) var(--r) 0 0;
    box-shadow: var(--sh3);
    display: flex; flex-direction: column;
    transform: translateY(calc(100% + 32px));
    transition: transform .3s cubic-bezier(.22,.68,0,1.1), opacity .25s ease, visibility .3s;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}
.chat-panel.open {
    transform: translateY(0); pointer-events: auto;
    opacity: 1; visibility: visible;
}
@media(min-width:769px) {
    .chat-panel {
        bottom: 24px; right: 24px;
        border-radius: var(--r);
        border: var(--glass-border);
        box-shadow: var(--sh3);
    }
}
.chat-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px 12px 16px;
    border-bottom: var(--glass-border);
    flex-shrink: 0;
    background: var(--surface2);
    gap: 8px;
}
.chat-header-title {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--fd); font-size: .88rem; font-weight: 800; color: var(--text);
    min-width: 0;
}
#chatHotelLabel {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 160px;
}
.chat-online-count {
    font-family: var(--fm); font-size: .6rem; color: var(--ready-tx);
    background: var(--ready-bg); border: 1px solid var(--ready-bd);
    padding: 2px 7px; border-radius: 99px; font-weight: 700;
    white-space: nowrap; flex-shrink: 0;
}
.chat-close-btn {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface2); cursor: pointer;
    color: var(--text-2); font-size: .78rem;
    display: flex; align-items: center; justify-content: center;
    transition: background .13s,border-color .13s;
    flex-shrink: 0;
}
.chat-close-btn:hover { background: var(--surface3); border-color: var(--border2) }
.chat-messages {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 14px 12px;
    display: flex; flex-direction: column; gap: 8px;
    scroll-behavior: smooth;
    background: var(--surface2);
}
.chat-messages:empty::after {
    content: "Noch keine Nachrichten";
    display: block; text-align: center;
    font-size: .75rem; color: var(--text-3);
    font-family: var(--fm); margin-top: 32px;
}
.chat-messages::-webkit-scrollbar { width: 3px }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px }
.chat-msg {
    display: flex; gap: 7px; align-items: flex-end;
    animation: fadeUp .15s ease both;
    max-width: 100%;
}
.chat-msg.mine { flex-direction: row-reverse }
.chat-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 800; font-family: var(--fd);
    letter-spacing: -.3px;
    border: 1.5px solid transparent;
    align-self: flex-end; margin-bottom: 14px;
}
.chat-msg-body {
    max-width: 75%; display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
}
.chat-msg.mine .chat-msg-body { align-items: flex-end }
.chat-bubble {
    padding: 9px 12px;
    border-radius: 18px 18px 18px 5px;
    background: var(--surface);
    border: var(--glass-border);
    font-size: .84rem; color: var(--text); line-height: 1.45;
    word-break: break-word;
    box-shadow: var(--sh0);
}
.chat-msg.mine .chat-bubble {
    background: linear-gradient(135deg,var(--accent),var(--accent-2));
    color: #fff;
    border-color: transparent;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 3px 12px color-mix(in srgb,var(--accent) 45%,transparent);
}
.chat-meta {
    font-family: var(--fm); font-size: .56rem; color: var(--text-3);
    padding: 0 5px; margin-top: 1px;
}
.chat-msg.mine .chat-meta { text-align: right }
.chat-sender {
    font-weight: 700; color: var(--text-2); font-size: .63rem;
    padding: 0 5px; margin-bottom: 2px;
}
.chat-date-divider {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--fm); font-size: .58rem;
    color: var(--text-3); padding: 6px 0; letter-spacing: .3px;
    text-transform: uppercase;
}
.chat-date-divider::before,
.chat-date-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.chat-input-row {
    display: flex; gap: 8px; padding: 10px 12px 10px;
    border-top: var(--glass-border); flex-shrink: 0;
    background: var(--surface2);
    align-items: center; position: relative;
}
.chat-input {
    flex: 1; padding: 9px 14px; border-radius: 99px;
    border: var(--glass-border); background: var(--surface);
    color: var(--text); font-size: .85rem; outline: none;
    transition: border-color .15s,background .15s,box-shadow .15s;
    font-family: var(--fs);
}
.chat-input::placeholder { color: var(--text-3) }
.chat-input:focus {
    border-color: var(--accent); background: var(--surface);
    box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 15%,transparent);
}
.chat-send-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: var(--accent); color: #fff; font-size: 1rem;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .13s,transform .1s,box-shadow .13s;
    box-shadow: 0 2px 8px color-mix(in srgb,var(--accent) 35%,transparent);
    font-weight: 700;
}
.chat-send-btn:hover { background: var(--accent-2); transform: scale(1.07) }
.chat-send-btn:active { transform: scale(.92) }
/* FAB */
.chat-fab {
    position: fixed;
    bottom: calc(var(--nb) + 14px + var(--sb));
    right: 16px;
    z-index: 1100;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 1.25rem;
    border: none; cursor: pointer;
    box-shadow: 0 4px 16px color-mix(in srgb,var(--accent) 45%,transparent),
    0 2px 6px rgba(0,0,0,.15);
    display: flex; align-items: center; justify-content: center;
    transition: transform .18s cubic-bezier(.22,.68,0,1.2),box-shadow .18s;
}
.chat-fab:hover { transform: scale(1.1) }
.chat-fab:active { transform: scale(.92) }
/* Shift FAB above bulk bar when active */
.has-bulk-bar .chat-fab { bottom: calc(var(--nb) + 14px + var(--sb) + 108px); transition: bottom .22s ease,transform .18s cubic-bezier(.22,.68,0,1.2),box-shadow .18s }
@media(min-width:769px) {
    .chat-fab { bottom: 24px; right: 24px }
    .has-bulk-bar .chat-fab { bottom: 100px }
}
/* ── @Mention autocomplete ── */
.mention-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--surface);
    border: var(--glass-border);
    border-radius: 14px;
    box-shadow: var(--sh3);
    overflow: hidden;
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
}
.mention-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--fs);
    transition: background .1s;
}
.mention-item:hover,
.mention-item.active { background: var(--surface2); }
.mention-av {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; font-weight: 800;
    font-family: var(--fd); flex-shrink: 0;
}

/* ── @mention highlight in bubbles ── */
.chat-mention {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    border-radius: 4px;
    padding: 1px 3px;
    font-weight: 700;
}
.chat-mention.me {
    background: color-mix(in srgb, #f59e0b 22%, transparent);
    color: #b45309;
}
.dark .chat-mention.me { color: #fbbf24; }

/* ── message row that mentions you ── */
.chat-msg.mention-highlight .chat-bubble {
    border-color: color-mix(in srgb, #f59e0b 50%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, #f59e0b 18%, transparent);
}

.chat-fab-badge {
    position: absolute; top: -2px; right: -2px;
    background: #E53E3A; color: #fff;
    border: 2px solid var(--bg);
    border-radius: 99px; padding: 1px 5px;
    font-family: var(--fm); font-size: .52rem; font-weight: 700;
    min-width: 16px; text-align: center; line-height: 1.4;
}

/* ── Chat Reactions ── */
.chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    position: relative;
}
.chat-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    background: var(--surface2);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    transition: border-color .12s, background .12s;
    user-select: none;
}
.chat-reaction-pill:hover,
.chat-reaction-pill.mine {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface2));
}
.chat-reaction-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    border-radius: 99px;
    border: 1.5px dashed var(--border);
    background: transparent;
    cursor: pointer;
    font-size: .75rem;
    color: var(--text-3);
    opacity: 0;
    transition: opacity .15s, border-color .12s, color .12s;
    flex-shrink: 0;
}
.chat-msg:hover .chat-reaction-add { opacity: 1; }
.chat-reaction-add:hover { border-color: var(--accent); color: var(--accent); }
.chat-reaction-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 10px;
    display: flex;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    z-index: 100;
    font-size: 1.25rem;
}
.chat-msg.mine .chat-reaction-picker { left: auto; right: 0; }
.chat-reaction-picker span { cursor: pointer; line-height: 1; transition: transform .1s; }
.chat-reaction-picker span:hover { transform: scale(1.3); }

/* ── Read Receipts ── */
.chat-read-receipts {
    display: flex;
    gap: 2px;
    margin-top: 3px;
    justify-content: flex-end;
}
.chat-receipt-av {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    font-size: .5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: .8;
}

