/* =========================================
   NEXUS COMPONENTS — Cards, Post Composer, Reactions, Comments
   ========================================= */

/* ── Stories bar ─────────────────────────── */
.nx-stories-wrapper {
    position: relative;
    margin-bottom: var(--nx-spacing-md);
}
.nx-stories-bar {
    display: flex;
    gap: var(--nx-spacing-sm);
    overflow-x: auto;
    padding: 12px;
    scrollbar-width: none;
    background: var(--nx-bg-card, #fff);
    border-radius: var(--nx-radius-lg, 12px);
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--nx-border-light, #e4e6eb);
    align-items: flex-start;
}
.nx-stories-bar::-webkit-scrollbar { display: none; }

.nx-story-card {
    flex-shrink: 0;
    width: 100px;
    height: 160px;
    border-radius: var(--nx-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: var(--nx-border);
}
.nx-story-card img:not(.nx-story-card-avatar) {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.nx-story-card:hover img:not(.nx-story-card-avatar) { transform: scale(1.05); }
.nx-story-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
}
.nx-story-card-avatar {
    position: absolute;
    top: 10px; left: 10px;
    width: 40px;
    height: 40px;
    border: 3px solid var(--nx-primary);
    box-shadow: 0 0 0 2px #fff;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.nx-story-card-name {
    position: absolute;
    bottom: 10px; left: 8px; right: 8px;
    font-size: 0.8rem; font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nx-story-add-card {
    flex-shrink: 0;
    width: 100px; height: 160px;
    border-radius: var(--nx-radius);
    background: var(--nx-card);
    border: 1px solid var(--nx-border);
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    padding-bottom: 12px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.nx-story-add-photo {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100px;
    object-fit: cover;
}
.nx-story-add-icon {
    position: absolute;
    top: 76px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 36px;
    background: var(--nx-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    border: 4px solid var(--nx-card);
    font-size: 1.25rem;
    font-weight: 700;
}
.nx-story-add-label {
    font-size: 0.8rem; font-weight: 600;
    color: var(--nx-text-primary);
    margin-top: 4px;
}
/* Seen ring */
.nx-story-card-seen .nx-story-card-avatar { border-color: rgba(255,255,255,0.5); box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

/* ── Story Viewer Overlay ────────────────── */
.nx-story-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nx-story-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    max-height: 750px;
    display: flex;
    flex-direction: column;
    background: #111;
    border-radius: var(--nx-radius-lg);
    overflow: hidden;
}
.nx-story-progress-track {
    height: 3px;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.nx-story-progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
}
.nx-story-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    flex-shrink: 0;
}
.nx-story-author-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nx-story-time-ago {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}
.nx-story-action-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background var(--nx-transition);
}
.nx-story-action-btn:hover { background: rgba(255,255,255,0.25); }
.nx-story-media-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.nx-story-media {
    width: 100%;
    height: 100%;
}
.nx-story-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--nx-transition);
    z-index: 2;
}
.nx-story-nav-btn:hover { background: rgba(255,255,255,0.35); }
.nx-story-nav-prev { left: 10px; }
.nx-story-nav-next { right: 10px; }
.nx-story-caption-bar {
    padding: 12px 16px;
    flex-shrink: 0;
    background: rgba(0,0,0,0.4);
}
.nx-story-caption-bar p {
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1em;
}

/* ── Story upload zone ───────────────────── */
.nx-story-upload-zone {
    border: 2px dashed var(--nx-border);
    border-radius: var(--nx-radius-md);
    padding: 32px 16px;
    text-align: center;
    background: var(--nx-bg-secondary);
    cursor: pointer;
    transition: border-color var(--nx-transition);
}
.nx-story-upload-zone:hover { border-color: var(--nx-primary); }

/* ── Post Composer ───────────────────────── */
.nx-post-composer {
    background: var(--nx-card);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow);
    border: 1px solid var(--nx-border-light);
    padding: var(--nx-spacing-md);
    margin-bottom: var(--nx-spacing-md);
}
.nx-composer-top {
    display: flex; align-items: center; gap: var(--nx-spacing-sm);
    margin-bottom: var(--nx-spacing-md);
}
.nx-composer-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-full);
    font-size: 0.9375rem;
    color: var(--nx-text-secondary);
    cursor: pointer;
    transition: background var(--nx-transition);
    text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nx-composer-input:hover { background: var(--nx-border-light); }
.nx-composer-divider { border: none; border-top: 1px solid var(--nx-border); margin: 0; }
.nx-composer-actions {
    display: flex; align-items: center; gap: 4px;
    padding-top: var(--nx-spacing-sm);
    flex-wrap: wrap;
}
.nx-composer-action-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border-radius: var(--nx-radius-sm);
    font-size: 0.875rem; font-weight: 600;
    color: var(--nx-text-secondary);
    cursor: pointer;
    transition: background var(--nx-transition);
    flex: 1;
    justify-content: center;
    min-width: 80px;
    text-decoration: none;
}
.nx-composer-action-btn:hover { background: var(--nx-bg); text-decoration: none; color: var(--nx-text-secondary); }
.nx-composer-action-btn svg { color: inherit; }

/* More button dropdown */
.nx-composer-more-wrap { position: relative; }
.nx-composer-more-btn  { flex: 0 0 auto; min-width: 0; padding: 8px 14px; }
.nx-composer-more-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: var(--nx-card);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow-md);
    z-index: 100;
    overflow: hidden;
}
.nx-composer-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nx-text-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background var(--nx-transition);
}
.nx-composer-more-item:hover { background: var(--nx-bg); }
.nx-composer-more-item svg { flex-shrink: 0; color: var(--nx-primary); }

/* Full composer (inside modal) */
.nx-full-composer { padding: 0; }
.nx-full-composer .nx-composer-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: var(--nx-spacing-md);
}
.nx-full-composer textarea {
    width: 100%;
    border: none; outline: none;
    resize: none;
    font-size: 1.125rem;
    background: transparent;
    color: var(--nx-text-primary);
    min-height: 100px;
    line-height: 1.5;
}
.nx-full-composer textarea::placeholder { color: var(--nx-text-muted); }
.nx-composer-media-preview {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: var(--nx-spacing-sm);
}
.nx-media-preview-item {
    position: relative;
    border-radius: var(--nx-radius-sm);
    overflow: hidden;
    width: 100px; height: 100px;
}
.nx-media-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.nx-media-preview-remove {
    position: absolute; top: 4px; right: 4px;
    width: 24px; height: 24px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    border: none; cursor: pointer;
    color: #fff; font-size: 0.875rem;
    display: flex; align-items: center; justify-content: center;
}
.nx-composer-privacy {
    display: flex; align-items: center;
    margin-bottom: var(--nx-spacing-sm);
}
.nx-privacy-select {
    padding: 4px 10px;
    border-radius: var(--nx-radius-sm);
    border: 1px solid var(--nx-border);
    font-size: 0.8125rem; font-weight: 600;
    background: var(--nx-bg);
    cursor: pointer;
}
.nx-composer-submit-row {
    display: flex; justify-content: flex-end;
    padding-top: var(--nx-spacing-sm);
    border-top: 1px solid var(--nx-border);
    margin-top: var(--nx-spacing-sm);
}

/* ── Feed Post Card ──────────────────────── */
.nx-post {
    background: var(--nx-card);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow);
    border: 1px solid var(--nx-border-light);
    margin-bottom: var(--nx-spacing-md);
    overflow: hidden;
}
.nx-post-header {
    display: flex; align-items: flex-start;
    padding: var(--nx-spacing-md) var(--nx-spacing-md) 0;
    gap: 10px;
}
.nx-post-meta { flex: 1; min-width: 0; }
.nx-post-author-name {
    font-weight: 700; font-size: 0.9375rem;
    color: var(--nx-text-primary);
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.nx-post-author-name:hover { text-decoration: underline; color: var(--nx-text-primary); }
.nx-post-time { font-size: 0.8125rem; color: var(--nx-text-secondary); display: block; margin-top: 1px; }
.nx-post-privacy-icon { color: var(--nx-text-muted); font-size: 0.75rem; }
.nx-post-options-btn {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--nx-text-secondary);
    cursor: pointer;
    transition: background var(--nx-transition);
    flex-shrink: 0;
    position: relative;
}
.nx-post-options-btn:hover { background: var(--nx-bg); }
.nx-post-options-dropdown {
    position: absolute; top: 100%; right: 0;
    min-width: 180px;
}
.nx-post-content {
    padding: var(--nx-spacing-sm) var(--nx-spacing-md) var(--nx-spacing-md);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--nx-text-primary);
    word-break: break-word;
}
.nx-post-content-expanded { font-size: 1.125rem; }
.nx-post-see-more { color: var(--nx-primary); font-weight: 600; cursor: pointer; }

/* Post media */
.nx-post-media { margin-top: var(--nx-spacing-xs); }
.nx-post-media-single img {
    width: 100%; max-height: 500px;
    object-fit: cover; cursor: pointer;
}
.nx-post-media-grid {
    display: grid;
    gap: 2px;
}
.nx-post-media-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.nx-post-media-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.nx-post-media-grid.cols-4 { grid-template-columns: 1fr 1fr; }
.nx-post-media-grid-item { position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer; }
.nx-post-media-grid-item img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--nx-transition); }
.nx-post-media-grid-item:hover img { opacity: 0.9; }
.nx-post-media-more {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem; font-weight: 700;
}

/* Link preview */
.nx-post-link-preview {
    margin: var(--nx-spacing-sm) var(--nx-spacing-md);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-sm);
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: box-shadow var(--nx-transition);
    background: var(--nx-bg-secondary);
}
.nx-post-link-preview:hover { box-shadow: var(--nx-shadow); text-decoration: none; }
.nx-post-link-preview img { width: 100%; height: 160px; object-fit: cover; }
.nx-post-link-info { padding: 12px; }
.nx-post-link-domain { font-size: 0.75rem; color: var(--nx-text-muted); text-transform: uppercase; }
.nx-post-link-title  { font-size: 0.9375rem; font-weight: 600; color: var(--nx-text-primary); margin: 4px 0; }
.nx-post-link-desc   { font-size: 0.8125rem; color: var(--nx-text-secondary); }

/* ── Reaction bar ────────────────────────── */
.nx-reaction-summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px var(--nx-spacing-md);
    border-top: 1px solid var(--nx-border-light);
}
.nx-reaction-count-display { display: flex; align-items: center; gap: 6px; }
.nx-reaction-emojis { display: flex; gap: -4px; }
.nx-reaction-emoji-icon { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--nx-card); margin-right: -6px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.nx-reaction-total { font-size: 0.875rem; color: var(--nx-text-secondary); cursor: pointer; }
.nx-reaction-total:hover { text-decoration: underline; color: var(--nx-primary); }
.nx-comment-share-count { display: flex; gap: var(--nx-spacing-md); }
.nx-count-link { font-size: 0.875rem; color: var(--nx-text-secondary); cursor: pointer; }
.nx-count-link:hover { text-decoration: underline; color: var(--nx-primary); }

.nx-post-actions {
    display: flex;
    border-top: 1px solid var(--nx-border-light);
}
.nx-action-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px;
    font-size: 0.875rem; font-weight: 600;
    color: var(--nx-text-secondary);
    cursor: pointer;
    border-radius: 0;
    transition: background var(--nx-transition), color var(--nx-transition);
    position: relative;
    border: none; background: none;
}
.nx-action-btn:hover { background: var(--nx-bg); color: var(--nx-text-primary); }
.nx-action-btn.is-active { color: var(--nx-primary); }
.nx-action-btn.is-active svg { color: var(--nx-primary); }

/* Reaction picker popup */
.nx-reaction-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: var(--nx-card);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-full);
    box-shadow: var(--nx-shadow-md);
    display: flex;
    padding: 8px 12px;
    gap: 4px;
    z-index: var(--nx-z-dropdown);
    animation: nx-dropdown-in 0.15s ease;
}
.nx-reaction-option {
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    padding: 4px;
    transition: transform 0.15s ease;
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    position: relative;
}
.nx-reaction-option:hover { transform: scale(1.4) translateY(-4px); }
.nx-reaction-option-label {
    position: absolute;
    bottom: 100%;
    left: 50%; transform: translateX(-50%);
    background: #333; color: #fff;
    font-size: 0.6875rem; font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--nx-radius-full);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.nx-reaction-option:hover .nx-reaction-option-label { opacity: 1; }

/* ── Comments ────────────────────────────── */
.nx-comments-section { padding: 0 var(--nx-spacing-md) var(--nx-spacing-md); }
.nx-comment-form { display: flex; align-items: center; gap: 8px; margin-bottom: var(--nx-spacing-sm); }
.nx-comment-input-wrap { flex: 1; position: relative; }
.nx-comment-input {
    width: 100%;
    padding: 9px 40px 9px 14px;
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius-full);
    font-size: 0.875rem;
    color: var(--nx-text-primary);
    outline: none;
    resize: none;
    transition: border-color var(--nx-transition);
    height: 38px;
    overflow: hidden;
}
.nx-comment-input:focus { border-color: var(--nx-primary); }
.nx-comment-input-actions {
    position: absolute; right: 8px; top: 50%;
    transform: translateY(-50%);
    display: flex; gap: 4px;
}

/* Comment item */
.nx-comment { display: flex; gap: 8px; margin-bottom: var(--nx-spacing-sm); }
.nx-comment-body { flex: 1; }
.nx-comment-bubble {
    display: inline-block;
    background: var(--nx-bg);
    border-radius: 0 var(--nx-radius) var(--nx-radius) var(--nx-radius);
    padding: 8px 12px;
    max-width: 100%;
}
.nx-comment-author {
    font-weight: 700; font-size: 0.875rem;
    color: var(--nx-text-primary);
    text-decoration: none;
}
.nx-comment-author:hover { text-decoration: underline; }
.nx-comment-text { font-size: 0.875rem; color: var(--nx-text-primary); word-break: break-word; }
.nx-comment-actions {
    display: flex; align-items: center; gap: var(--nx-spacing-md);
    margin-top: 4px; padding-left: 4px;
}
.nx-comment-action {
    font-size: 0.75rem; font-weight: 700; color: var(--nx-text-secondary);
    cursor: pointer; border: none; background: none;
}
.nx-comment-action:hover { color: var(--nx-primary); }
.nx-comment-action.is-liked { color: var(--nx-primary); }
.nx-comment-time { font-size: 0.75rem; color: var(--nx-text-muted); }
.nx-comment-likes { font-size: 0.75rem; color: var(--nx-text-secondary); }

/* Replies */
.nx-replies { margin-left: 48px; margin-top: 8px; }
.nx-view-replies-btn { font-size: 0.8125rem; font-weight: 700; color: var(--nx-text-secondary); cursor: pointer; margin: 4px 0 4px 48px; display: flex; align-items: center; gap: 6px; }
.nx-view-replies-btn:hover { color: var(--nx-primary); }
.nx-load-more-comments { display: block; font-size: 0.875rem; font-weight: 700; color: var(--nx-text-secondary); cursor: pointer; padding: 4px 0; }
.nx-load-more-comments:hover { color: var(--nx-primary); }

/* ── Notifications ───────────────────────── */
.nx-notif-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background var(--nx-transition);
    position: relative;
}
.nx-notif-item:hover { background: var(--nx-bg); text-decoration: none; }
.nx-notif-item.is-unread { background: var(--nx-primary-light); }
.nx-notif-item.is-unread:hover { background: var(--nx-border-light); }
.nx-notif-avatar-wrap { position: relative; flex-shrink: 0; }
.nx-notif-type-icon {
    position: absolute; bottom: -2px; right: -4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    border: 2px solid var(--nx-card);
}
.nx-notif-content { flex: 1; min-width: 0; }
.nx-notif-text  { font-size: 0.875rem; color: var(--nx-text-primary); line-height: 1.4; }
.nx-notif-text strong { font-weight: 700; }
.nx-notif-time  { font-size: 0.75rem; color: var(--nx-primary); font-weight: 600; margin-top: 2px; }
.nx-notif-thumb { width: 44px; height: 44px; border-radius: var(--nx-radius-sm); object-fit: cover; flex-shrink: 0; }
.nx-notif-unread-dot {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    width: 10px; height: 10px;
    background: var(--nx-primary);
    border-radius: 50%;
}

/* ── Search dropdown ─────────────────────── */
.nx-search-result-section { padding: 8px 0; }
.nx-search-result-section-title { padding: 6px 16px; font-size: 0.75rem; font-weight: 700; color: var(--nx-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.nx-search-section-label { padding: 6px 14px 4px; font-size: 0.72rem; font-weight: 700; color: var(--nx-text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.nx-search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    transition: background var(--nx-transition);
}
.nx-search-result-item:hover { background: var(--nx-bg-secondary); text-decoration: none; }
.nx-search-result-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nx-search-result-name { font-size: 0.9rem; font-weight: 600; color: var(--nx-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-search-result-sub { font-size: 0.8rem; color: var(--nx-text-muted); }
.nx-search-result-meta { font-size: 0.8rem; color: var(--nx-text-secondary); }
.nx-search-no-results { padding: 16px; text-align: center; color: var(--nx-text-muted); font-size: 0.875rem; }
.nx-search-empty { padding: 14px 16px; text-align: center; color: var(--nx-text-muted); font-size: 0.875rem; }
.nx-search-see-all {
    display: block;
    padding: 10px 14px;
    margin-top: 4px;
    border-top: 1px solid var(--nx-border);
    background: var(--nx-bg-secondary);
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--nx-primary);
    text-decoration: none;
    border-radius: 0 0 var(--nx-radius) var(--nx-radius);
    transition: background var(--nx-transition);
}
.nx-search-see-all:hover { background: var(--nx-bg); text-decoration: none; color: var(--nx-primary-dark, #1565c0); }

/* ── Auth pages (login, register) ─────────── */
.nx-auth-page {
    min-height: calc(100vh - 60px);
    background: var(--nx-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--nx-spacing-lg) var(--nx-spacing-md);
}
.nx-auth-container {
    width: 100%;
    max-width: 420px;
}
.nx-auth-container-lg { max-width: 520px; }
.nx-auth-card {
    background: var(--nx-card);
    border-radius: var(--nx-radius-lg);
    box-shadow: 0 2px 16px rgba(0,0,0,.10);
    padding: 32px;
}
.nx-auth-logo { text-align: center; margin-bottom: var(--nx-spacing-lg); }
.nx-auth-logo-text {
    display: block;
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--nx-primary);
    letter-spacing: -0.5px;
}
.nx-auth-tagline { font-size: 1rem; color: var(--nx-text-secondary); margin-top: 6px; }
.nx-auth-form { margin-top: var(--nx-spacing-md); }
.nx-auth-divider {
    text-align: center;
    margin: var(--nx-spacing-md) 0;
    position: relative;
}
.nx-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: var(--nx-border);
}
.nx-auth-divider span {
    position: relative;
    background: var(--nx-card);
    padding: 0 12px;
    font-size: 0.875rem;
    color: var(--nx-text-muted);
}
.nx-auth-footer { text-align: center; margin-top: var(--nx-spacing-md); font-size: 0.875rem; color: var(--nx-text-muted); }
.nx-auth-footer a { color: var(--nx-primary); font-weight: 600; text-decoration: none; }
.nx-auth-footer a:hover { text-decoration: underline; }

/* Password toggle */
.nx-password-wrap { position: relative; }
.nx-show-password {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--nx-text-muted); padding: 4px;
    display: flex; align-items: center;
}
.nx-show-password:hover { color: var(--nx-text-primary); }
.nx-password-wrap .nx-input { padding-right: 40px; }

/* Alert box */
.nx-alert {
    padding: 12px 16px;
    border-radius: var(--nx-radius);
    margin-bottom: var(--nx-spacing-md);
    font-size: 0.9rem;
}
.nx-alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.nx-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.nx-alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Composer type panels ─────────────────── */
.nx-composer-type-section {
    margin: 12px 0;
    padding: 14px;
    background: var(--nx-bg);
    border-radius: var(--nx-radius);
    border: 1px solid var(--nx-border-light);
}
.nx-composer-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.nx-composer-field:last-child { margin-bottom: 0; }
.nx-composer-field label { font-size: .8125rem; font-weight: 600; color: var(--nx-text-secondary); }
.nx-composer-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 28px;
    border: 2px dashed var(--nx-border);
    border-radius: var(--nx-radius);
    cursor: pointer;
    transition: border-color var(--nx-transition), background var(--nx-transition);
    text-align: center;
    width: 100%;
}
.nx-composer-upload-area:hover { border-color: var(--nx-primary); background: var(--nx-primary-light); }

/* Feeling grid */
.nx-feeling-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.nx-feeling-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 4px;
    border-radius: var(--nx-radius-sm);
    border: 2px solid transparent;
    background: var(--nx-card);
    cursor: pointer;
    transition: border-color var(--nx-transition), background var(--nx-transition);
}
.nx-feeling-item:hover { background: var(--nx-primary-light); border-color: var(--nx-primary); }
.nx-feeling-item.is-selected { border-color: var(--nx-primary); background: var(--nx-primary-light); }
.nx-feeling-emoji { font-size: 1.5rem; line-height: 1; }
.nx-feeling-label { font-size: .7rem; font-weight: 500; color: var(--nx-text-secondary); }

/* ── Link preview card ────────────────────── */
.nx-link-preview-loading {
    display: flex; align-items: center; gap: 8px;
    padding: 10px;
    font-size: .85rem;
    color: var(--nx-text-muted);
}
.nx-link-preview-card {
    position: relative;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    overflow: hidden;
    background: var(--nx-card);
    margin: 10px 0;
    cursor: default;
}
.nx-link-preview-img img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}
.nx-link-preview-body {
    padding: 10px 14px 12px;
}
.nx-link-preview-domain {
    display: flex; align-items: center; gap: 5px;
    font-size: .75rem;
    color: var(--nx-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.nx-link-preview-favicon {
    width: 14px; height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}
.nx-link-preview-title {
    font-weight: 700;
    font-size: .9375rem;
    color: var(--nx-text-primary);
    margin-bottom: 4px;
    line-height: 1.35;
}
.nx-link-preview-desc {
    font-size: .8125rem;
    color: var(--nx-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.nx-link-preview-url {
    font-size: .75rem;
    color: var(--nx-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.nx-link-preview-url:hover { text-decoration: underline; }
.nx-link-preview-close {
    position: absolute;
    top: 8px; right: 8px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--nx-transition);
}
.nx-link-preview-close:hover { background: rgba(0,0,0,.8); }

/* ── Video embed (YouTube / Vimeo) in posts ── */
.nx-post-video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--nx-radius);
    background: #000;
    margin: 10px 0 0;
}
.nx-post-video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Link card in post feed ──────────────── */
.nx-post-link-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    overflow: hidden;
    text-decoration: none;
    margin: 10px 0 0;
    transition: box-shadow var(--nx-transition);
}
.nx-post-link-card:hover { box-shadow: var(--nx-shadow-md); text-decoration: none; }
.nx-post-link-card-img img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}
.nx-post-link-card-body {
    padding: 10px 14px 12px;
    background: var(--nx-bg);
}
.nx-post-link-card-domain {
    display: flex; align-items: center; gap: 5px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--nx-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}
.nx-post-link-card-title {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--nx-text-primary);
    margin-bottom: 3px;
    line-height: 1.35;
}
.nx-post-link-card-desc {
    font-size: .8125rem;
    color: var(--nx-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nx-link-preview-yt-badge {
    position: absolute;
    bottom: 8px; left: 8px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

/* ── Analytics modal ────────────────────── */
.nx-analytics-modal .nx-modal-body { padding: var(--nx-spacing-md); }
.nx-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--nx-spacing-md);
    margin-bottom: var(--nx-spacing-md);
}
.nx-stat-card {
    background: var(--nx-bg);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    padding: 16px;
    text-align: center;
}
.nx-stat-card .nx-stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--nx-text-primary);
    line-height: 1;
}
.nx-stat-card .nx-stat-label {
    font-size: 0.8125rem;
    color: var(--nx-text-muted);
    margin-top: 4px;
}
.nx-analytics-chart-wrap { margin-bottom: var(--nx-spacing-md); }
.nx-analytics-chart-wrap h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nx-text-secondary);
    margin-bottom: 10px;
}
.nx-bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 80px; }
.nx-bar-chart-bar {
    flex: 1;
    background: var(--nx-primary);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: height .4s ease;
    position: relative;
}
.nx-bar-chart-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--nx-text-muted);
    white-space: nowrap;
}
.nx-analytics-chart-wrap.has-bars { padding-bottom: 22px; }
.nx-top-post-wrap { margin-top: var(--nx-spacing-sm); }
.nx-top-post-wrap h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nx-text-secondary);
    margin-bottom: 8px;
}
.nx-top-post-excerpt {
    padding: 10px 14px;
    background: var(--nx-bg);
    border-radius: var(--nx-radius);
    border: 1px solid var(--nx-border);
    font-size: 0.875rem;
    color: var(--nx-text-secondary);
    line-height: 1.45;
}

/* ── Bg-color composer palette ────────────── */
.nx-bg-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: var(--nx-spacing-sm) var(--nx-spacing-md);
}
.nx-bg-swatch {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
}
.nx-bg-swatch:hover { transform: scale(1.15); }
.nx-bg-swatch.is-selected { border-color: #fff; box-shadow: 0 0 0 2px var(--nx-primary); }
.nx-bg-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    border-radius: var(--nx-radius);
    margin: 0 var(--nx-spacing-md);
    padding: 16px;
    transition: background .2s;
}
.nx-bg-preview .nx-bg-preview-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.3);
    text-align: center;
    width: 100%;
    pointer-events: none;
}

/* ── Composer more item (dropdown) ────────── */
.nx-composer-more-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--nx-text-primary);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    border-radius: 0;
    transition: background var(--nx-transition);
}
.nx-composer-more-item:hover { background: var(--nx-bg); }
.nx-composer-more-item svg { color: var(--nx-text-muted); flex-shrink: 0; }
.nx-composer-more-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    right: 0;
    background: var(--nx-card);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow-md);
    min-width: 180px;
    z-index: 200;
    overflow: hidden;
    display: none;
}
.nx-composer-more-dropdown.is-open { display: block; }
.nx-composer-more-wrap { position: relative; display: inline-block; }

/* ── Group cards ─────────────────────────── */
.nx-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--nx-spacing-md);
    margin-bottom: var(--nx-spacing-xl);
}
.nx-group-card {
    background: var(--nx-card);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--nx-transition), transform var(--nx-transition);
    display: flex;
    flex-direction: column;
}
.nx-group-card:hover {
    box-shadow: var(--nx-shadow-md);
    transform: translateY(-2px);
}
.nx-group-card-cover-link { display: block; }
.nx-group-card-cover {
    width: 100%;
    height: 100px;
    background-size: cover;
    background-position: center;
    background-color: var(--nx-primary);
    background-image: linear-gradient(135deg, var(--nx-primary), #8B5CF6);
}
.nx-group-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.nx-group-card-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--nx-text-primary);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nx-group-card-name:hover { color: var(--nx-primary); text-decoration: none; }
.nx-group-card-meta {
    font-size: 0.8125rem;
    color: var(--nx-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.nx-group-card-desc {
    font-size: 0.8125rem;
    color: var(--nx-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    flex: 1;
}
.nx-group-card .nx-group-action-btn {
    margin-top: auto;
}
.nx-group-card .nx-btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ── Groups page header ──────────────────── */
.nx-groups-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--nx-spacing-md);
    flex-wrap: wrap;
    gap: var(--nx-spacing-sm);
}
.nx-groups-page-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--nx-text-primary);
    margin: 0;
}
.nx-groups-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--nx-text-primary);
    margin: 0 0 var(--nx-spacing-md);
}
.nx-groups-search-bar {
    margin-bottom: var(--nx-spacing-lg);
    display: flex;
    gap: 8px;
}
.nx-groups-search-bar .nx-input { flex: 1; }

/* Story count badge */
.nx-story-count-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--nx-primary, #1877F2);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 20px;
    text-align: center;
    line-height: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.35);
    z-index: 2;
    pointer-events: none;
}

/* Story thumbnail strip */
.nx-story-thumb-strip {
    display: flex;
    gap: 4px;
    padding: 8px 12px 10px;
    overflow-x: auto;
    background: rgba(0,0,0,0.55);
    scrollbar-width: none;
    border-radius: 0 0 var(--nx-radius) var(--nx-radius);
}
.nx-story-thumb-strip::-webkit-scrollbar { display: none; }
.nx-story-thumb {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity .15s, border-color .15s;
    background-color: #333;
}
.nx-story-thumb:hover { opacity: 0.8; }
.nx-story-thumb-active {
    opacity: 1;
    border-color: #fff;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
}

/* Stories bar nav arrows */
.nx-stories-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nx-text-primary, #050505);
    transition: box-shadow .15s, background .15s;
}
.nx-stories-nav-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.28); background: #f5f5f5; }
.nx-stories-nav-prev { left: -14px; }
.nx-stories-nav-next { right: -14px; }
