/* ============================================================
   Nexus Messenger — Pinned Messages (Patch 03, v1.29.21)
   ============================================================ */

.nx-pin-overlay {
    position: fixed;
    inset: 0;
    z-index: 12500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: nx-pin-fade 0.18s ease;
}
@keyframes nx-pin-fade { from { opacity: 0; } to { opacity: 1; } }

.nx-pin-modal {
    width: min(540px, 94vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-panel, var(--bg-secondary, #1e1f24));
    color: var(--text-primary, #e9e9ee);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: nx-pin-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes nx-pin-pop {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.nx-pin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
.nx-pin-title { font-size: 16px; font-weight: 700; }
.nx-pin-head-actions { display: flex; align-items: center; gap: 8px; }
.nx-pin-unpinall {
    border: none;
    background: rgba(229, 72, 77, 0.16);
    color: #ff8087;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.nx-pin-unpinall:hover { background: rgba(229, 72, 77, 0.28); }
.nx-pin-close {
    border: none;
    background: transparent;
    color: var(--text-secondary, #9aa0aa);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 8px;
}
.nx-pin-close:hover { background: var(--bg-hover, rgba(255, 255, 255, 0.06)); color: #fff; }

.nx-pin-body { padding: 8px; overflow-y: auto; }
.nx-pin-status { text-align: center; color: var(--text-secondary, #9aa0aa); font-size: 13px; padding: 22px 0; }

.nx-pin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.13s;
}
.nx-pin-item:hover { background: var(--bg-hover, rgba(255, 255, 255, 0.06)); }

.nx-pin-prev {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input, rgba(255, 255, 255, 0.05));
    overflow: hidden;
}
.nx-pin-thumb { width: 100%; height: 100%; object-fit: cover; }
.nx-pin-ticon { font-size: 20px; }

.nx-pin-main { flex: 1; min-width: 0; }
.nx-pin-text {
    font-size: 14px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.nx-pin-meta { font-size: 11px; color: var(--text-secondary, #9aa0aa); margin-top: 3px; }

.nx-pin-unpin {
    flex: 0 0 auto;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-secondary, #c4c8d0);
    cursor: pointer;
    font-size: 13px;
}
.nx-pin-unpin:hover { background: rgba(229, 72, 77, 0.24); color: #ff8087; }

/* — счётчик «N закреплённых» в шапке (pinned-banner) — */
.pinned-banner .pinned-count {
    font-size: 11px;
    color: var(--accent, #6ea8fe);
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
}
.pinned-banner .pinned-count:hover { text-decoration: underline; }
