@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    background-color: #f3f5f9;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #1e293b;
    line-height: 1.5;
}

body.nx-body-layout {
    display: block;
    padding: 0;
    overflow: hidden;
}

.nx-icon{
    width: 24px;
    height: 24px;
}

body:not(.nx-body-layout) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    height: 100vh;
}

.nx-app {
    display: flex;
    width: 100%;
    max-width: 100%;
    height: 100vh;
}

.nx-sidebar {
    width: 280px;
    min-width: 280px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    background: #f8f9fc;
}

.nx-logo-text {
    font-size: 26px;
    font-weight: 800;
    color: #4285f4;
    margin-bottom: 40px;
    padding-left: 20px;
    letter-spacing: -1px;
}

.nx-nav-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nx-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: 18px;
    color: #64748b;
    font-weight: 600;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    width: 100%;
    text-align: left;
}

.nx-nav-link:hover {
    color: #4285f4;
    background: rgba(66, 133, 244, 0.08);
}

.nx-nav-link.active {
    color: #ffffff;
    background: #4285f4;
    box-shadow: 0 8px 20px rgba(66, 133, 244, 0.2);
}

.nx-nav-link.exit-btn {
    margin-top: auto;
    color: #f43f5e;
}

.nx-feed {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
    max-width: 720px;
    margin: 0 auto;
    scrollbar-width: none;
}

.nx-feed::-webkit-scrollbar {
    display: none;
}

.nx-post-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.03);
    text-align: left;
}

.nx-post-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.nx-post-avatar {
    width: 48px;
    height: 48px;
    background: #e2e8f0;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
}

.nx-post-author {
    font-weight: 800;
    font-size: 16px;
    color: #0f172a;
}

.nx-post-handle {
    font-size: 13px;
    color: #64748b;
}

.nx-content-bubble {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 20px;
    border-top-left-radius: 4px;
    margin-bottom: 12px;
    position: relative;
    transition: background 0.2s ease;
}

.nx-content-bubble:hover {
    background: #eef2f6;
}

.nx-post-content {
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
    text-align: left;
    white-space: normal;
    word-break: break-word;
}

.nx-clamp-text {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nx-text-highlight {
    background: #ffffff;
    color: #4285f4;
    padding: 2px 8px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid rgba(66, 133, 244, 0.1);
}

.nx-quote {
    border-left: 4px solid #4285f4;
    background: rgba(255,255,255,0.5);
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 12px 12px 0;
    color: #475569;
    font-style: italic;
}

.nx-read-more-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 10px;
    color: #475569;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.nx-read-more-btn:hover {
    background: #4285f4;
    color: #fff;
    border-color: #4285f4;
}

.nx-post-media {
    margin: 4px 0 16px 0;
    border-radius: 20px;
    overflow: hidden;
}

.nx-post-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.nx-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nx-action-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nx-action-btn.liked {
    color: #f43f5e;
}

.nx-action-icon {
    width: 20px;
    height: 20px;
}

.nx-writer-box textarea {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 20px;
    font-size: 16px;
    resize: none;
    outline: none;
    min-height: 120px;
    margin-bottom: 20px;
    font-family: inherit;
    transition: all 0.2s;
}

.nx-writer-box textarea:focus {
    border-color: #4285f4;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.1);
}

.nx-btn-post {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.nx-btn-post:hover {
    background: #0f172a;
    transform: translateY(-2px);
}

.nx-writer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nx-grid-single { display: block; height: 400px; }
.nx-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; height: 300px; }
.nx-grid-three { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 150px 150px; gap: 10px; }
.nx-grid-three div:nth-child(1) { grid-row: span 2; }
.nx-grid-5 { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: 240px 160px; gap: 10px; }
.nx-grid-5 div:nth-child(1), .nx-grid-5 div:nth-child(2) { grid-column: span 3; }
.nx-grid-5 div:nth-child(3), .nx-grid-5 div:nth-child(4), .nx-grid-5 div:nth-child(5) { grid-column: span 2; }

.nx-img-item {
    background-color: #e2e8f0;
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
}

.nx-tabbar {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    padding: 8px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.nx-tab-item { color: #64748b; padding: 12px; border-radius: 16px; display: flex; text-decoration: none; }
.nx-tab-item.active { color: #4285f4; background: rgba(66, 133, 244, 0.08); }
.nx-tab-plus { width: 48px; height: 48px; background: #1e293b; color: #ffffff; border-radius: 16px; display: flex; align-items: center; justify-content: center; }

#notify {
    position: fixed;
    z-index: 99999;
    display: flex;
    gap: 10px;
    pointer-events: none;
    flex-direction: column-reverse;
    right: 20px;
    bottom: 20px;
    width: 320px;
}

.notify-item {
    pointer-events: auto;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.notify-item.notify-error {
    background: #ffeded;
    border: 1px solid #ffb8b8;
    color: #d93025;
}

.notify-item.notify-success {
    background: #ecfdf3;
    border: 1px solid #b7ebc9;
    color: #15803d;
}

.notify-item.notify-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}

.notify-item.notify-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.skeleton { position: relative; overflow: hidden; background: #fff; }
.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    animation: shimmer 1.6s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-modal.active {
    display: flex;
    opacity: 1;
}

.photo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.photo-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.photo-modal-viewer {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10002;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.photo-modal-close svg {
    width: 24px;
    height: 24px;
}

.photo-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10002;
}

.photo-modal-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.photo-modal-nav svg {
    width: 24px;
    height: 24px;
}

.photo-modal-prev {
    left: 20px;
}

.photo-modal-next {
    right: 20px;
}

.photo-modal-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10002;
}

#mediaPreview {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin: 0 0 16px 0;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

#mediaPreview::-webkit-scrollbar {
    display: none;
}

.nx-preview-item {
    position: relative;
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(66, 133, 244, 0.18);
    background: #f8fafc;
    transition: all 0.2s ease;
    animation: scaleIn 0.2s ease-out;
}

.nx-preview-item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
    pointer-events: none;
}

.nx-preview-item:hover {
    border-color: #4285f4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
}

.nx-preview-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
}

.nx-preview-image video,
.nx-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 16px;
}

.nx-remove-preview {
    position: absolute;
    top: 6px;
    right: 6px;
    bottom: auto;
    width: 24px;
    height: 24px;
    background: #f43f5e;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nx-remove-preview:hover {
    background: #e23c54;
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#fileInput {
    display: none;
}

.nx-upload-btn,
.nx-tool-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
}

.nx-upload-btn:hover,
.nx-tool-btn:hover {
    background: #ffffff;
    border-color: rgba(66, 133, 244, 0.35);
    color: #4285f4;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(66, 133, 244, 0.12);
}

.nx-upload-btn svg,
.nx-tool-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.nx-btn-post {
    position: relative;
    min-width: 160px;
    height: 46px;
    padding: 0 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nx-btn-post:hover {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.22);
}

.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.nx-btn-post.loading .btn-text {
    display: none;
}

.nx-btn-post.loading .btn-loader {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nx-like-btn.liked {
    color: #ef4444;
}

.nx-writer-box {
    padding: 18px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top left, rgba(66, 133, 244, 0.08), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    border: 1px solid rgba(66, 133, 244, 0.08);
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.06),
        0 4px 14px rgba(15, 23, 42, 0.04);
}

.nx-writer-form-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nx-writer-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nx-writer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e2e8f0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.nx-writer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nx-writer-user-meta {
    min-width: 0;
}

.nx-writer-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.nx-writer-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.nx-writer-input-wrap {
    position: relative;
}

#postContent{
    scroll-margin-top: 100px; 
}

.nx-writer-box textarea#postContent {
    margin-bottom: 0;
    min-height: 130px;
    padding: 18px 18px 52px 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, #f8fafc 0%, #fdfefe 100%);
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.nx-writer-box textarea#postContent::placeholder {
    color: #94a3b8;
}

.nx-writer-box textarea#postContent:focus {
    border-color: #4285f4;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(66, 133, 244, 0.08),
        0 10px 24px rgba(66, 133, 244, 0.06);
}

.nx-writer-tip {
    position: absolute;
    left: 16px;
    bottom: 14px;
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
}

.nx-writer-actions {
    gap: 14px;
    padding-top: 2px;
}

.nx-writer-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nx-post-length-counter {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nx-post-length-counter.is-limit {
    color: #f43f5e;
}

.nx-writer-input-wrap .nx-post-length-counter {
    padding-right: 4px;
}

.nx-video-preview {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 220px;
    border-radius: 20px;
    overflow: hidden;
    background: #0f172a;
}

.nx-video-preview-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0f172a;
    pointer-events: none;
}

.nx-video-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px;
    background: linear-gradient(to top, rgba(15,23,42,0.12), rgba(15,23,42,0.02) 40%, transparent 70%);
    pointer-events: none;
}

.nx-video-preview-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nx-video-preview-badge svg {
    width: 15px;
    height: 15px;
    margin-left: 1px;
}

.nx-video-modal-player {
    position: relative;
    width: min(92vw, 520px);
    max-height: 88vh;
    aspect-ratio: 9 / 16;
    border-radius: 24px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.nx-video-modal-el {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.nx-video-modal-el::-webkit-media-controls {
    display: none !important;
    -webkit-appearance: none;
}

.nx-video-modal-el::-webkit-media-controls-enclosure {
    display: none !important;
    -webkit-appearance: none;
}

.nx-video-modal-toggle {
    position: absolute;
    left: 14px;
    bottom: 38px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nx-video-modal-toggle:hover {
    background: rgba(15, 23, 42, 0.72);
}

.nx-video-modal-toggle svg {
    width: 16px;
    height: 16px;
    display: block;
}

.nx-video-modal-player .nx-video-icon-pause {
    display: none;
}

.nx-video-modal-player.is-playing .nx-video-icon-play {
    display: none;
}

.nx-video-modal-player.is-playing .nx-video-icon-pause {
    display: block;
}

.nx-video-speed-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    min-width: 38px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: 0.18s ease;
}

.nx-video-speed-badge.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.nx-video-modal-progress {
    --value: 0%;
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    width: calc(100% - 24px);
    height: 4px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #ffffff var(--value), rgba(255,255,255,0.28) var(--value));
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.nx-video-modal-progress::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
    border-radius: 999px;
}

.nx-video-modal-progress::-moz-range-track {
    height: 4px;
    background: transparent;
    border-radius: 999px;
}

.nx-video-modal-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    margin-top: -3px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    opacity: 1;
}

.nx-video-modal-progress::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    opacity: 1;
}

.nx-grid-single .nx-video-preview {
    min-height: 400px;
}

.nx-grid-two .nx-video-preview {
    min-height: 300px;
}

.nx-grid-three .nx-video-preview,
.nx-grid-5 .nx-video-preview {
    min-height: 100%;
    height: 100%;
}

/* старые стили комментариев оставлены */
.nx-comments-section {
    background: #f8fafc;
    border-radius: 18px;
    padding: 16px;
    margin: 12px 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.nx-comments-section.is-visible {
    max-height: 800px;
    opacity: 1;
    padding: 16px;
}

.nx-comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
    margin-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.nx-comments-list::-webkit-scrollbar {
    width: 6px;
}

.nx-comments-list::-webkit-scrollbar-track {
    background: transparent;
}

.nx-comments-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.nx-comments-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.nx-comment {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
    transition: background 0.2s ease;
}

.nx-comment:hover {
    background: #f1f5f9;
}

.nx-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.nx-comment-body {
    flex: 1;
    min-width: 0;
}

.nx-comment-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.nx-comment-author {
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
}

.nx-comment-handle {
    font-size: 12px;
    color: #94a3b8;
}

.nx-comment-content {
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    word-break: break-word;
}

.nx-comment-form {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 12px;
}

.nx-comment-input-wrap {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.nx-comment-input {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    resize: none;
    outline: none;
    font-family: inherit;
    min-height: 36px;
    max-height: 80px;
    transition: all 0.2s;
}

.nx-comment-input:focus {
    border-color: #4285f4;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.08);
}

.nx-comment-submit {
    background: #1e293b;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.nx-comment-submit:hover:not(:disabled) {
    background: #0f172a;
    transform: translateY(-1px);
}

.nx-comment-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nx-comment-counter {
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
    margin-top: 4px;
    transition: color 0.2s ease;
}

.nx-comment-counter.is-limit {
    color: #f43f5e;
}

.nx-action-btn[data-comments-btn] {
    transition: all 0.2s ease;
}

/* МОДАЛКА КОММЕНТОВ */
.nx-comments-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 11000;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.nx-comments-modal.active {
    display: flex;
    opacity: 1;
}

.nx-comments-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}

.nx-comments-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(680px, calc(100vw - 24px));
    max-height: min(86vh, 860px);
    margin: auto;
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.nx-comments-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.nx-comments-modal-title-wrap {
    min-width: 0;
}

.nx-comments-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.nx-comments-modal-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
}

.nx-comments-modal-close {
    width: 42px;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nx-comments-modal-close:hover {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

.nx-comments-modal-close svg {
    width: 20px;
    height: 20px;
}

.nx-comments-modal-body {
    flex: 1;
    min-height: 260px;
    max-height: 60vh;
    overflow-y: auto;
    background:
        radial-gradient(circle at top right, rgba(66, 133, 244, 0.05), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #f4f7fb 100%);
}

.nx-comments-chat {
    height: 100%;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.nx-comments-chat::-webkit-scrollbar {
    width: 6px;
}

.nx-comments-chat::-webkit-scrollbar-track {
    background: transparent;
}

.nx-comments-chat::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.nx-comment-chat-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.nx-comment-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    background-color: #dbe5f0;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.nx-comment-chat-main {
    min-width: 0;
    max-width: calc(100% - 48px);
}

.nx-comment-chat-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    padding-left: 2px;
}

.nx-comment-chat-name {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.nx-comment-chat-username {
    font-size: 12px;
    color: #94a3b8;
}

.nx-comment-chat-bubble {
    display: inline-block;
    max-width: 100%;
    padding: 11px 14px;
    border-radius: 18px;
    border-top-left-radius: 6px;
    background: #ffffff;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    border: 1px solid #e8eef5;
}

.nx-comments-empty-modal,
.nx-comments-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nx-comments-loading-bubble,
.nx-comments-empty-modal {
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e8eef5;
    border-radius: 18px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.nx-comments-modal-form {
    padding: 16px 18px 14px;
    border-top: 1px solid #eef2f7;
    background: #ffffff;
}

.nx-comments-modal-input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.nx-comments-modal-input {
    flex: 1;
    min-height: 46px;
    max-height: 140px;
    resize: none;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    background: #f8fafc;
    padding: 12px 15px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    outline: none;
    transition: all 0.2s ease;
}

.nx-comments-modal-input:focus {
    border-color: #4285f4;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.08);
}

.nx-comments-modal-submit {
    min-width: 110px;
    height: 46px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 18px;
    flex-shrink: 0;
}

.nx-comments-modal-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.nx-comments-modal-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nx-comments-modal-counter {
    margin-top: 6px;
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.nx-comments-modal-counter.is-limit {
    color: #f43f5e;
}

.input-error {
    border-color: #f43f5e !important;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.08) !important;
}

.shake-input {
    animation: shakeInput 0.35s ease;
}

@keyframes shakeInput {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-4px);
    }
    40% {
        transform: translateX(4px);
    }
    60% {
        transform: translateX(-3px);
    }
    80% {
        transform: translateX(3px);
    }
}

.login-card { background: #ffffff; width: 100%; max-width: 440px; padding: 50px 40px; border-radius: 40px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); text-align: center; }
.input-control { width: 100%; background-color: #f1f4f9; border: 2px solid transparent; border-radius: 20px; padding: 16px 20px; font-size: 16px; outline: none; }
.input-control:focus { border-color: #4285f4; background-color: #ffffff; }
.btn-submit { width: 100%; background: #1a1a1a; color: #ffffff; font-weight: 700; padding: 18px; border-radius: 22px; border: none; cursor: pointer; transition: all 0.3s; }

@media (max-width: 900px) {
    .nx-sidebar { display: none; }
    .nx-tabbar { display: flex; }
    .nx-feed { padding: 15px; padding-bottom: 120px; max-width: 100%; }
    
    .photo-modal-nav {
        width: 40px;
        height: 40px;
    }
    
    .photo-modal-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .photo-modal-prev {
        left: 10px;
    }
    
    .photo-modal-next {
        right: 10px;
    }

    .nx-comments-section {
        padding: 12px;
    }

    .nx-comments-list {
        max-height: 300px;
    }

    .nx-comment {
        padding: 8px;
        gap: 8px;
    }

    .nx-comment-avatar {
        width: 32px;
        height: 32px;
    }

    .nx-comment-input {
        font-size: 13px;
        padding: 8px 12px;
    }

    .nx-comment-submit {
        padding: 8px 14px;
        font-size: 11px;
        min-width: 70px;
    }

    .nx-writer-box {
        padding: 14px;
        border-radius: 22px;
    }

    .nx-writer-header {
        gap: 10px;
    }

    .nx-writer-avatar {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .nx-writer-box textarea#postContent {
        min-height: 112px;
        padding: 15px 15px 46px 15px;
        border-radius: 18px;
    }

    .nx-btn-post {
        min-width: 140px;
        height: 44px;
    }

    .nx-video-modal-player {
        width: 94vw;
        border-radius: 20px;
    }

    .nx-video-modal-toggle {
        left: 10px;
        bottom: 32px;
        width: 34px;
        height: 34px;
    }

    .nx-video-modal-progress {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: calc(100% - 20px);
    }

    .nx-video-speed-badge {
        top: 10px;
        right: 10px;
    }

    .nx-comments-modal-dialog {
        width: calc(100vw - 12px);
        max-height: 92vh;
        border-radius: 22px;
    }

    .nx-comments-modal-header {
        padding: 14px;
    }

    .nx-comments-modal-title {
        font-size: 16px;
    }

    .nx-comments-modal-subtitle {
        max-width: 220px;
    }

    .nx-comments-chat {
        padding: 14px;
    }

    .nx-comment-chat-avatar {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .nx-comment-chat-bubble {
        font-size: 13px;
        padding: 10px 12px;
    }

    .nx-comments-modal-form {
        padding: 12px;
    }

    .nx-comments-modal-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .nx-comments-modal-submit {
        width: 100%;
        min-width: 0;
    }
}

















