/* Note extras: centred popups, activity panel, copy menu, client label, retry buttons */
.nx-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    animation: nx-fade 0.15s ease;
}

.nx-card {
    width: min(420px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 100%);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    scrollbar-width: thin;
    scrollbar-color: var(--purple-primary) transparent;
    animation: nx-pop 0.15s ease;
}

.nx-card.nx-picker {
    width: min(350px, 100%);
    padding: 0;
    overflow: visible;
    background: none;
    border: none;
    box-shadow: none;
}

.nx-picker emoji-picker { max-width: 100%; width: 100%; }

@keyframes nx-fade { from { opacity: 0; } }
@keyframes nx-pop { from { opacity: 0; transform: scale(0.96); } }

/* Buttons added to each note's action row */
.feed-item .feed-actions,
.conversation-note .feed-actions {
    flex-wrap: wrap;
    align-items: center;
}

.nx-client {
    margin-left: auto;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75em;
    color: #999;
    padding: 2px 8px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 10px;
}

@media (max-width: 576px) {
    .feed-item .feed-actions,
    .conversation-note .feed-actions { gap: 2px; }
    .feed-actions .nx-extra { padding: 8px; min-width: 32px; }
}

/* Activity panel */
.nx-title { font-weight: 600; margin-bottom: 12px; }
.nx-title i { color: var(--purple-primary); }
.nx-section { margin-bottom: 14px; }
.nx-section h6 { font-size: 0.85em; color: #bbb; margin-bottom: 6px; }

.nx-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.nx-chip {
    padding: 3px 10px;
    font-size: 0.85em;
    cursor: pointer;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    transition: background 0.2s;
}

.nx-chip:hover { background: rgba(168, 85, 247, 0.35); }
.nx-chip b { color: var(--bitcoin-orange); font-weight: 600; }
.nx-glyph { font-size: 1.3em; line-height: 1; }
.nx-emoji { width: 1.3em; height: 1.3em; vertical-align: middle; }
.nx-empty, .nx-foot { font-size: 0.8em; color: #999; margin: 6px 0 0; }

/* Menu */
.nx-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    cursor: pointer;
    border-radius: 10px;
}

.nx-author:hover { background: rgba(168, 85, 247, 0.15); }
.nx-author img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.nx-author div { min-width: 0; display: flex; flex-direction: column; }
.nx-author small { color: #999; overflow: hidden; text-overflow: ellipsis; }

.nx-row { display: flex; gap: 6px; margin-bottom: 6px; }
.nx-row .nx-btn:first-child { flex: 1; }

.nx-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: all 0.2s;
}

.nx-btn:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.25);
    border-color: var(--purple-primary);
}

.nx-btn:disabled { opacity: 0.6; }
.nx-btn.nx-hex { width: auto; font-family: monospace; font-size: 0.85em; }

/* Retry: failed quoted notes and broken images/videos */
.quoted-note.nx-failed,
.nx-media-fail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nx-media-fail {
    margin: 8px 0;
    padding: 10px 12px;
    font-size: 0.85em;
    color: #bbb;
    background: rgba(168, 85, 247, 0.06);
    border: 1px dashed rgba(168, 85, 247, 0.4);
    border-radius: 10px;
}

.nx-retry {
    flex: none;
    padding: 4px 10px;
    font-size: 0.8em;
    color: #fff;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    transition: background 0.2s;
}

.nx-retry:hover:not(:disabled) { background: rgba(168, 85, 247, 0.4); }
.nx-retry:disabled { opacity: 0.6; }

.nx-spin { display: inline-block; animation: nx-rotate 0.8s linear infinite; }
@keyframes nx-rotate { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
    /* Narrow screens: if the text fills the box, the button wraps onto its own line instead of being pushed out */
    .quoted-note.nx-failed,
    .nx-media-fail { flex-wrap: wrap; row-gap: 8px; }
    .quoted-note.nx-failed > div,
    .nx-media-fail > span { min-width: 0; flex: 1 1 auto; }
    .nx-retry { margin-left: auto; padding: 6px 12px; }
}
