:root {
    color-scheme: light;
    --bg: #edf2fb;
    --surface: #ffffff;
    --surface-soft: #e8edf8;
    --line: #cfd7e6;
    --text: #151a2b;
    --text-soft: #5d6680;
    --accent: #2f4df7;
}
html.dark {
    color-scheme: dark;
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-soft: #1a1a1a;
    --line: #2a2a2a;
    --text: #f0f0f0;
    --text-soft: #a3a3a3;
    --accent: #e5e5e5;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }
.page { min-height: 100vh; padding: 28px; display: grid; place-items: center; }
.layout {
    width: min(1120px, 100%);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(12, 20, 44, .14);
}
.header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.header-links { display: flex; align-items: center; gap: 14px; color: var(--text-soft); font-size: .95rem; position: relative; }
.icon-btn {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.theme-toggle {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text);
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    cursor: pointer;
    box-sizing: border-box;
}
.avatar-chip {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    border: 1px solid var(--line);
    box-sizing: border-box;
}
.avatar-btn { cursor: pointer; }
.topbar-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(320px, 92vw);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 18px 40px rgba(10, 15, 29, .2);
    padding: 12px;
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 60;
}
.topbar-popover.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.popover-title { margin: 0 0 10px; font-size: .86rem; color: var(--text-soft); }
.apps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.apps-grid a {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 8px;
    display: grid;
    justify-items: center;
    gap: 5px;
    font-size: .78rem;
    color: var(--text-soft);
    background: var(--surface-soft);
}
.apps-grid a:hover { color: var(--text); }
.account-popover { width: min(360px, 92vw); }
.account-email { margin: 0 0 10px; font-size: .85rem; color: var(--text-soft); }
.account-main { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.account-avatar { width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.account-avatar.account-avatar--photo {
    padding: 0;
    overflow: hidden;
    background: transparent !important;
    color: transparent;
}
.account-avatar.account-avatar--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}
.account-actions { display: flex; gap: 8px; }
.btn { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--text); padding: 8px 10px; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.tiny { padding: 6px 10px; font-size: .78rem; }
.hero { padding: 26px 20px; }
h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
.lead { margin: 0 0 18px; color: var(--text-soft); max-width: 700px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); padding: 16px; min-height: 150px; }
.muted { color: var(--text-soft); }
@media (max-width: 900px) {
    .page { padding: 14px; }
    .header { flex-direction: column; align-items: flex-start; }
    .header-links { width: 100%; justify-content: space-between; }
    .grid { grid-template-columns: 1fr; }
}

/* NEX — full viewport layout */
body.nex-body { margin: 0; min-height: 100vh; }
body.nex-modal-open { overflow: hidden; }

.nex-app {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    align-items: stretch;
}

.nex-sidebar {
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}
.nex-sidebar-brand { display: flex; flex-direction: column; gap: 2px; }
.nex-sidebar-logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.06em;
    color: var(--text);
}
.nex-sidebar-tag { font-size: .72rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; }
.nex-sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nex-side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: .92rem;
    color: var(--text-soft);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
    width: 100%;
}
.nex-side-link:hover { color: var(--text); background: var(--surface-soft); }
.nex-side-link.is-active { color: var(--text); border-color: var(--line); background: var(--surface-soft); font-weight: 600; }
.nex-side-btn { border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); }
.nex-sidebar-divider { height: 1px; background: var(--line); margin: 8px 0; opacity: .7; }
.muted-link { opacity: .85; font-size: .88rem !important; }
.nex-badge {
    margin-left: auto;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
}

.nex-main-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    background: var(--bg);
}
.nex-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    position: sticky;
    top: 0;
    z-index: 40;
}
.nex-toolbar-fill { flex: 1; }
.nex-sidebar-toggle { display: none; }

.nex-main {
    flex: 1;
    padding: 22px 22px 48px;
    width: 100%;
    max-width: min(920px, 100%);
    margin: 0 auto;
}

.nex-h1 { margin: 0 0 8px; font-size: 1.55rem; letter-spacing: -.03em; }
.nex-h2 { margin: 0 0 10px; font-size: 1.1rem; }
.nex-sub { margin: 0 0 20px; }
.nex-flash {
    padding: 10px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-soft));
    border: 1px solid var(--line);
    margin-bottom: 16px;
    font-size: .92rem;
}
.nex-errors {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #c44;
    background: color-mix(in srgb, #c44 8%, var(--surface));
    margin-bottom: 16px;
    font-size: .88rem;
}
.nex-feed-head { margin-bottom: 18px; }

.nex-avatar-img, .nex-avatar-letter {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
}
.nex-avatar-letter {
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    font-size: .85rem;
}
.nex-avatar-sm { width: 36px; height: 36px; font-size: .85rem; }
.nex-avatar-md { width: 48px; height: 48px; font-size: 1rem; }
.nex-avatar-xl { width: 88px; height: 88px; font-size: 2rem; }

.nex-post-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-weight: 700;
}
.nex-post-author-row-lg { gap: 14px; align-items: flex-start; }
.nex-post-meta { text-align: right; }
.nex-post-time-link { color: inherit; }

.nex-post-list { display: flex; flex-direction: column; gap: 14px; }
.nex-post-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    background: var(--surface-soft);
}
.nex-post-card--compact { padding: 12px 14px; }
.nex-post-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 10px;
    font-size: .88rem;
}
.nex-post-body {
    margin: 0 0 10px;
    /* pre-line убирает «левые» пробелы/отступ первой строки; переносы строк сохраняются */
    white-space: pre-line;
    word-break: break-word;
    text-align: start;
    box-sizing: border-box;
    max-width: 100%;
}

.nex-post-media-grid {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
}
.nex-post-media-grid--1 { grid-template-columns: 1fr; }
.nex-post-media-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nex-post-media-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 140px 140px; }
.nex-post-media-grid--3 .nex-post-media-cell:first-child { grid-row: span 2; }
.nex-post-media-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 120px; }

.nex-post-media-cell { display: block; overflow: hidden; background: var(--surface); }
.nex-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 360px;
    display: block;
}
.nex-post-video {
    width: 100%;
    max-height: 360px;
    border-radius: 12px;
    background: #000;
}

.nex-post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.nex-like-form { display: inline; margin: 0; }
.nex-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    font: inherit;
    font-size: .86rem;
    cursor: pointer;
}
.nex-action-btn.is-active {
    color: #e2556b;
    border-color: color-mix(in srgb, #e2556b 45%, var(--line));
    background: color-mix(in srgb, #e2556b 10%, var(--surface));
}
.nex-action-muted { font-size: .86rem; color: var(--text-soft); }
.nex-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: .86rem;
    color: var(--text-soft);
}
.nex-read-more { margin-left: auto; font-size: .88rem; font-weight: 600; color: var(--accent); }

.nex-pagination { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: .9rem; }

.nex-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.nex-profile-form { max-width: 560px; }
.nex-label { font-size: .88rem; font-weight: 600; color: var(--text-soft); }

/* Единый стиль полей NEX */
input.nex-input,
select.nex-input,
.nex-input[type="text"],
.nex-input[type="number"],
.nex-input[type="search"],
.nex-input[type="email"],
.nex-field-text {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    padding: 11px 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}
input.nex-input:focus,
select.nex-input:focus,
.nex-field-text:focus {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.nex-textarea,
textarea.nex-textarea {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    padding: 12px 14px;
    font: inherit;
    font-size: .95rem;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}
.nex-textarea:focus {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.nex-input-full { width: 100%; max-width: 480px; }

/* Загрузка файлов — в одном стиле с полями NEX */
input[type="file"].nex-file-input {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 8px 12px 8px 10px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    background: var(--surface);
    color: var(--text-soft);
    font-size: .86rem;
    cursor: pointer;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}
input[type="file"].nex-file-input:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
    background: color-mix(in srgb, var(--surface-soft) 35%, var(--surface));
}
input[type="file"].nex-file-input:focus,
input[type="file"].nex-file-input:focus-visible {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
input[type="file"].nex-file-input:disabled {
    opacity: .55;
    cursor: not-allowed;
}
input[type="file"].nex-file-input::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, #3d4d6e 0%, #2f3c58 100%);
    box-shadow: 0 2px 10px rgba(32, 44, 72, .22);
    transition: filter .12s ease, box-shadow .12s ease;
}
input[type="file"].nex-file-input::file-selector-button:hover {
    filter: brightness(1.06);
}
input[type="file"].nex-file-input::-webkit-file-upload-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, #3d4d6e 0%, #2f3c58 100%);
    box-shadow: 0 2px 10px rgba(32, 44, 72, .22);
}
html.dark input[type="file"].nex-file-input::file-selector-button {
    background: linear-gradient(180deg, #3a3a3a 0%, #262626 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
html.dark input[type="file"].nex-file-input::-webkit-file-upload-button {
    background: linear-gradient(180deg, #3a3a3a 0%, #262626 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

/* Предпросмотр вложений в модалке нового поста */
.nex-post-files-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.nex-post-files-preview[hidden] {
    display: none !important;
}
.nex-post-file-thumb-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
}
.nex-post-file-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    background: var(--surface-soft);
}
.nex-post-file-thumb--video {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
    color: var(--accent);
    font-size: 1.35rem;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.nex-post-file-cap {
    font-size: .68rem;
    color: var(--text-soft);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.nex-post-file-thumb-wrap--name {
    font-size: .78rem;
    padding: 8px;
    border-radius: 12px;
    border: 1px dashed color-mix(in srgb, var(--line) 75%, transparent);
    text-align: center;
    word-break: break-word;
    color: var(--text-soft);
}

.nex-checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--text-soft); max-width: 560px; }
.nex-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.nex-post-single-title { font-size: 1.25rem !important; margin: 0 !important; }
.nex-post-single-meta { margin: 4px 0 0; font-size: .88rem; }
.nex-post-media-single { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.nex-post-img-full, .nex-post-video-full {
    width: 100%;
    border-radius: 14px;
    max-height: min(70vh, 640px);
    object-fit: contain;
    background: #000;
}
.nex-post-single-body { line-height: 1.55; word-break: break-word; margin-bottom: 16px; }
.nex-post-single-actions { margin-bottom: 24px; }

.nex-comments { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.nex-comment-form { margin-bottom: 18px; max-width: 100%; }
.nex-comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.nex-comment {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}
.nex-comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 6px;
    font-size: .86rem;
}
.nex-comment-author { font-weight: 700; color: var(--accent); }
.nex-comment-time { font-size: .78rem; margin-left: auto; }
.nex-comment-delete { margin-left: 8px; }
.nex-comment-body { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .92rem; }
.nex-link-danger {
    background: none;
    border: none;
    color: #c44;
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
    padding: 0;
}

.nex-profile-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.nex-profile-head-text { min-width: 0; }
.nex-profile-bio { margin: 8px 0 0; line-height: 1.45; }
.nex-profile-id { font-size: .82rem; margin: 6px 0 0; }
.nex-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}
.nex-profile-posts-title { margin-top: 8px; }

.nex-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    background: var(--surface-soft);
    margin-bottom: 18px;
}
.nex-friends-section .nex-h2 { margin-top: 0; }
.nex-friend-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nex-friend-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.nex-friend-row:last-child { border-bottom: none; }
.nex-friend-row-actions { display: flex; gap: 8px; }
.nex-friend-remove { margin-left: auto; }

.nex-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 16px;
    visibility: hidden;
    opacity: 0;
    transition: opacity .2s ease;
}
.nex-modal.open { visibility: visible; opacity: 1; }
.nex-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 26, .55);
}
.nex-modal-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: min(88vh, 900px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(10, 15, 29, .28);
}
.nex-modal-wide { width: min(640px, 100%); }
.nex-modal-dm { width: min(960px, 100%); max-height: min(86vh, 720px); }
.nex-modal-dm .nex-modal-head { display: none; }
.nex-modal-close--dm {
    position: absolute; top: 12px; right: 12px; z-index: 3;
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text-soft); display: grid; place-items: center;
    font-size: 1rem; cursor: pointer;
}
.nex-modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.nex-modal-title { margin: 0; font-size: 1.1rem; }
.nex-modal-close {
    border: none; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text-soft);
}
.nex-modal-body { padding: 16px; overflow-y: auto; }
.nex-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.nex-dm-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    height: min(560px, 78vh);
    min-height: 420px;
    max-height: min(78vh, 680px);
}
.nex-dm-list-wrap {
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--surface-soft);
}
.nex-dm-list-head { padding: 16px 16px 12px; flex-shrink: 0; }
.nex-dm-list-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.nex-dm-start { display: flex; gap: 8px; padding: 0 12px 10px; flex-wrap: wrap; }
.nex-dm-conv-list {
    list-style: none; margin: 0; padding: 4px 8px 10px; overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 2px;
}
.nex-dm-conv-btn {
    width: 100%; text-align: left; padding: 10px; border-radius: 12px; border: none;
    background: transparent; cursor: pointer; font: inherit; color: var(--text);
    display: flex; align-items: center; gap: 10px;
}
.nex-dm-conv-btn:hover { background: color-mix(in srgb, var(--surface) 88%, transparent); }
.nex-dm-conv-btn.is-active { background: var(--surface); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06); }
.nex-dm-conv-avatar, .nex-dm-thread-avatar {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--line);
    overflow: hidden; display: grid; place-items: center;
    font-size: .95rem; font-weight: 700; color: var(--text-soft);
}
.nex-dm-avatar-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.nex-dm-avatar-letter {
    display: grid; place-items: center; width: 100%; height: 100%;
    font-size: .95rem; font-weight: 700; color: var(--text-soft);
    background: var(--surface-soft);
}
.nex-dm-conv-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.nex-dm-conv-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nex-dm-conv-preview { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nex-dm-thread-wrap {
    padding: 0; overflow: hidden; display: flex; flex-direction: column;
    min-height: 0; height: 100%; background: var(--surface);
}
.nex-dm-empty-state {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; padding: 24px; text-align: center;
}
.nex-dm-empty-icon { font-size: 2.2rem; color: color-mix(in srgb, var(--text-soft) 70%, transparent); }
.nex-dm-panel-loaded { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }
.nex-dm-placeholder { margin: 0; font-size: .9rem; max-width: 260px; }
.nex-dm-thread-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.nex-dm-thread-back { display: none; flex-shrink: 0; }
.nex-dm-thread-peer { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.nex-dm-thread-name-link {
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    transition: color .15s ease;
}
.nex-dm-thread-name-link:hover { color: var(--accent); }
.nex-dm-thread-name-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
}
.nex-dm-thread-peer-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nex-dm-thread-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nex-dm-thread-status { font-size: .78rem; }
.nex-dm-panel-scroll {
    flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto;
    border: none; padding: 16px 14px; background: color-mix(in srgb, var(--bg) 55%, var(--surface));
    box-sizing: border-box;
}

.nex-dm-compose { flex-shrink: 0; margin-top: auto; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.nex-dm-compose-bar {
    display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px 6px 14px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft);
}
.nex-dm-compose-bar:focus-within {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
    background: var(--surface);
}
.nex-dm-compose-input {
    flex: 1; min-width: 0; border: none; background: transparent; resize: none;
    font: inherit; font-size: .92rem; line-height: 1.45; color: var(--text);
    max-height: 120px; padding: 8px 0; overflow-y: auto;
}
.nex-dm-compose-input:focus { outline: none; }
.nex-dm-compose-input::placeholder { color: var(--text-soft); }
.nex-dm-compose-tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.nex-dm-compose-tool { width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-soft); opacity: .55; }
.nex-dm-compose-send {
    flex-shrink: 0; width: 36px; height: 36px; border: none; border-radius: 10px;
    display: grid; place-items: center; cursor: pointer; background: var(--accent); color: #0a0a0a;
}
.nex-dm-compose-send:disabled { opacity: .35; cursor: not-allowed; }

.chat-attachment {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    text-align: left;
}
.chat-attachment-img {
    display: block;
    max-width: min(220px, 100%);
    max-height: 180px;
    border-radius: 10px;
    object-fit: contain;
    border: 1px solid var(--line);
    pointer-events: none;
}
.nex-message-body img {
    display: block;
    max-width: min(260px, 100%);
    max-height: 200px;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid var(--line);
    cursor: zoom-in;
}
.unlias-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.unlias-image-lightbox.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.unlias-image-lightbox-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 26, .82); cursor: zoom-out; }
.unlias-image-lightbox-dialog { position: relative; z-index: 1; margin: 0; max-width: min(96vw, 1200px); max-height: 92vh; }
.unlias-image-lightbox-img { display: block; max-width: min(96vw, 1200px); max-height: 92vh; object-fit: contain; border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.unlias-image-lightbox-close {
    position: absolute; top: -12px; right: -12px; width: 40px; height: 40px; border: none; border-radius: 999px;
    background: var(--surface); color: var(--text); font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
body.unlias-image-lightbox-open { overflow: hidden; }

.chat-message--appear {
    animation: chat-message-in 0.22s ease-out both;
}

@keyframes chat-message-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-message--appear {
        animation: none;
    }
}

.nex-message-list { display: flex; flex-direction: column; gap: 14px; }
.nex-message { display: flex; flex-direction: column; gap: 4px; width: fit-content; max-width: min(78%, 420px); }
.nex-message--pending { opacity: 0.78; }
.nex-message-own { align-self: flex-end; align-items: flex-end; }
.nex-message-theirs { align-self: flex-start; align-items: flex-start; }
.nex-message-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
.nex-message-bubble { width: fit-content; border-radius: 16px; padding: 10px 14px; min-width: 0; max-width: 100%; }
.nex-message-own .nex-message-bubble {
    background: linear-gradient(180deg, var(--accent-light, #60a5fa), var(--accent));
    color: #0a0a0a; border: none; border-bottom-right-radius: 6px;
}
.nex-message-theirs .nex-message-bubble {
    background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px;
}
.nex-message-author { display: none; }
.nex-message-body { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .92rem; line-height: 1.45; }
.unlias-user-mention { color: var(--accent, #3b82f6); font-weight: 600; text-decoration: none; }
.unlias-user-mention:hover { text-decoration: underline; }
.nex-message-own .nex-message-body, .nex-message-own .unlias-user-mention { color: inherit; }
.nex-message-time { font-size: .72rem; flex-shrink: 0; white-space: nowrap; padding-bottom: 4px; }
.nex-message-read { font-size: .72rem; padding-right: 4px; }
.nex-chat-form { display: flex; flex-direction: column; gap: 10px; }
.nex-chat-input { min-height: 44px; }

.nex-back { margin-top: 28px; font-size: .92rem; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1024px) {
    .nex-app { grid-template-columns: 1fr; }
    .nex-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: min(280px, 88vw);
        z-index: 50;
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: 12px 0 40px rgba(10, 15, 29, .18);
    }
    .nex-sidebar.open { transform: translateX(0); }
    .nex-sidebar-toggle { display: grid; }
    .nex-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 45;
        background: rgba(15, 23, 42, 0.4);
        border: 0;
        margin: 0;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .nex-sidebar-backdrop:not([hidden]) {
        display: block;
    }
    html.dark .nex-sidebar-backdrop:not([hidden]) {
        background: rgba(0, 0, 0, 0.55);
    }
    .nex-sidebar .nex-side-link,
    .nex-sidebar .nex-side-btn {
        min-height: 44px;
    }
}

@media (max-width: 720px) {
    .nex-dm-layout { grid-template-columns: 1fr; max-height: none; min-height: min(70vh, 560px); }
    .nex-dm-list-wrap { border-right: none; border-bottom: 1px solid var(--line); max-height: 38vh; }
    .nex-modal-dm.nex-dm-has-thread .nex-dm-list-wrap { display: none; }
    .nex-dm-thread-back { display: inline-grid; }
    .nex-dm-panel-scroll {
        min-height: 200px;
    }
}

/* Toolbar search */
.nex-toolbar-dropdown { position: relative; display: flex; align-items: center; }
.nex-toolbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: min(440px, 52vw);
    min-width: 0;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    box-shadow:
        inset 2px 2px 6px rgba(255, 255, 255, .55),
        inset -2px -2px 8px rgba(12, 22, 48, .08);
}
html.dark .nex-toolbar-search {
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, .25), inset -1px -1px 6px rgba(255, 255, 255, .04);
}
.nex-toolbar-search-icon { color: var(--text-soft); font-size: .85rem; }
.nex-toolbar-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    outline: none;
}
.nex-toolbar-search-input::placeholder { color: var(--text-soft); opacity: .85; }
.nex-toolbar-search:focus-within {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent),
        inset 2px 2px 6px rgba(255, 255, 255, .55),
        inset -2px -2px 8px rgba(12, 22, 48, .08);
}

@media (max-width: 520px) {
    .nex-toolbar-search { max-width: none; }
}

/* Post card menu & mature */
.nex-post-card-head-right { display: flex; align-items: flex-start; gap: 8px; }
.nex-post-menu { position: relative; }
.nex-post-menu > summary.nex-post-menu-btn {
    list-style: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    line-height: 1;
}
.nex-post-menu > summary::-webkit-details-marker { display: none; }
.nex-post-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    min-width: 180px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(10, 15, 29, .2);
}
.nex-post-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    font: inherit;
    font-size: .88rem;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
}
.nex-post-menu-item:hover { background: var(--surface-soft); }
.nex-post-menu-item--danger { color: #c44; }
.nex-post-menu--single { margin-left: auto; }
.nex-post-single-head--row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.nex-post-single-head--row .nex-post-author-row-lg { flex: 1; min-width: 0; }

.nex-mature-badge {
    display: inline-block;
    margin: 0 0 8px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #fff;
    background: #a02850;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Profile shell (NEX style) */
.nex-profile-shell {
    margin: -8px -8px 24px;
}
.nex-profile-banner-wrap {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 12px 32px rgba(12, 20, 44, .12);
}
.nex-profile-banner {
    min-height: 160px;
    background-size: cover;
    background-position: center;
}
.nex-profile-banner--gradient {
    min-height: 160px;
    background: linear-gradient(135deg, #1c2b6d 0%, #2f4df7 45%, #6b8cff 100%);
    position: relative;
}
.nex-profile-banner-logo {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -.06em;
    color: rgba(255, 255, 255, .9);
}
.nex-profile-banner-inner {
    position: absolute;
    left: 20px;
    bottom: -44px;
}
.nex-avatar-profile, .nex-avatar-xl.nex-avatar-profile {
    width: 108px;
    height: 108px;
    border-radius: 999px;
    border: 4px solid var(--surface);
    box-shadow: 0 10px 24px rgba(10, 15, 29, .18);
}
.nex-profile-card {
    margin-top: 56px;
    padding: 18px 18px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow:
        6px 6px 18px rgba(12, 22, 48, .08),
        -4px -4px 14px rgba(255, 255, 255, .75);
}
html.dark .nex-profile-card {
    box-shadow: 6px 6px 18px rgba(0, 0, 0, .35);
}
.nex-profile-title-row { margin-bottom: 14px; }
.nex-profile-name {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.04em;
}
.nex-profile-handle {
    margin: 4px 0 0;
    font-size: .95rem;
    color: var(--text-soft);
}
.nex-profile-tagline {
    margin: 10px 0 0;
    line-height: 1.45;
    color: var(--text-soft);
}
.nex-profile-id-badge { margin: 8px 0 0; font-size: .82rem; }

.nex-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}
.nex-stat-card {
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    background: var(--surface-soft);
    box-shadow: inset 2px 2px 6px rgba(255, 255, 255, .5), inset -2px -2px 8px rgba(12, 22, 48, .06);
}
.nex-stat-card--raised {
    box-shadow:
        6px 6px 14px rgba(12, 22, 48, .1),
        -3px -3px 10px rgba(255, 255, 255, .8);
}
html.dark .nex-stat-card--raised {
    box-shadow: 6px 6px 14px rgba(0, 0, 0, .35);
}
.nex-stat-label { display: block; font-size: .78rem; color: var(--text-soft); margin-bottom: 4px; }
.nex-stat-value { font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; }

.nex-profile-actions--main { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.nex-btn-soft {
    background: var(--surface-soft);
}
.nex-btn-primary-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nex-profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.nex-profile-tab {
    font-weight: 600;
    font-size: .92rem;
    color: var(--text-soft);
    padding-bottom: 6px;
    border-bottom: 2px solid transparent;
}
.nex-profile-tab:hover { color: var(--text); }
.nex-profile-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.nex-profile-meta-sidebar {
    margin: 18px 0 0;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
    background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
    display: grid;
    gap: 10px;
}
.nex-profile-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: .88rem;
}
.nex-profile-meta-row dt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-soft);
}
.nex-profile-meta-row dd { margin: 0; font-weight: 600; }

@media (min-width: 720px) {
    .nex-profile-card-inner-grid {
        display: grid;
        grid-template-columns: 1fr 180px;
        gap: 18px;
        align-items: start;
    }
}

/* Profile hero: banner + overlapping avatar (reference layout) */
.nex-profile-hero {
    margin: 0 0 24px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow:
        6px 6px 18px rgba(12, 22, 48, .08),
        -4px -4px 14px rgba(255, 255, 255, .75);
    overflow: hidden;
}
html.dark .nex-profile-hero {
    box-shadow: 6px 6px 18px rgba(0, 0, 0, .32);
}
.nex-profile-cover-wrap {
    position: relative;
}
.nex-profile-cover {
    min-height: 168px;
}
.nex-profile-cover--img {
    background-size: cover;
    background-position: center;
}
.nex-profile-cover--gradient {
    min-height: 168px;
    background: linear-gradient(118deg, #141c30 0%, #273552 42%, #4a5f86 100%);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 16px 20px 0;
}
.nex-profile-cover-logo {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -.06em;
    color: rgba(255, 255, 255, .9);
    text-shadow: 0 2px 12px rgba(0, 0, 0, .22);
}

.nex-profile-avatar-wrap {
    position: absolute;
    left: 22px;
    bottom: 0;
    transform: translateY(50%);
    z-index: 2;
}
.nex-profile-avatar-ring {
    position: relative;
    display: inline-block;
    border-radius: 999px;
    padding: 4px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(10, 15, 29, .18);
}
.nex-avatar-hero.nex-avatar-img,
.nex-avatar-hero.nex-avatar-letter {
    width: 108px;
    height: 108px;
    border-radius: 999px;
    display: block;
    object-fit: cover;
}
.nex-avatar-hero.nex-avatar-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
}
.nex-profile-presence {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #22c55e;
    border: 3px solid var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.nex-profile-hero-inner {
    padding: 66px 22px 18px;
}
.nex-profile-hero-head {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    justify-content: space-between;
    align-items: flex-start;
}
.nex-profile-hero-text {
    min-width: 0;
    flex: 1;
}
.nex-profile-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}
.nex-profile-hero .nex-profile-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.04em;
}
.nex-profile-id-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-soft);
    background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}
.nex-profile-hero .nex-profile-bio {
    margin: 10px 0 0;
    font-size: .94rem;
    line-height: 1.55;
}
.nex-profile-handle-line {
    margin: 8px 0 0;
    font-size: .9rem;
    color: var(--text-soft);
}
.nex-profile-joined-line {
    margin: 6px 0 0;
    font-size: .82rem;
}

.nex-profile-quick-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.nex-profile-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: none;
    text-decoration: none;
    color: var(--text);
    background: color-mix(in srgb, var(--surface-soft) 90%, transparent);
    box-shadow:
        inset 1px 1px 3px rgba(255, 255, 255, .65),
        inset -1px -1px 4px rgba(12, 22, 48, .06),
        2px 2px 10px rgba(12, 22, 48, .06);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, color .12s ease;
    font: inherit;
    padding: 0;
}
.nex-profile-icon-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        inset 1px 1px 3px rgba(255, 255, 255, .7),
        3px 4px 14px rgba(12, 22, 48, .12);
    color: var(--accent);
}
.nex-profile-icon-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.nex-profile-icon-form {
    margin: 0;
    display: inline-block;
}
.nex-profile-icon-form .nex-profile-icon-btn {
    width: 42px;
    height: 42px;
}

.nex-profile-stats--ref {
    margin: 18px 0 16px;
}
.nex-profile-stats--ref .nex-stat-card--ref {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 12px;
    gap: 6px;
}
.nex-profile-stats--ref .nex-stat-label {
    margin: 0;
    order: 2;
}
.nex-profile-stats--ref .nex-stat-value {
    order: 1;
    font-size: 1.35rem;
}

.nex-profile-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}
.nex-profile-cta {
    flex: 1 1 160px;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 600;
    font-size: .92rem;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font: inherit;
}
.nex-profile-cta--primary {
    background: linear-gradient(180deg, #3d4d6e 0%, #2f3c58 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(32, 44, 72, .28);
}
.nex-profile-cta--primary:hover {
    filter: brightness(1.05);
}
html.dark .nex-profile-cta--primary {
    background: linear-gradient(180deg, #e5e5e5 0%, #c8c8c8 100%);
    color: #0a0a0a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
}
.nex-profile-cta--secondary {
    background: color-mix(in srgb, var(--surface-soft) 96%, transparent);
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
    box-shadow: inset 1px 1px 3px rgba(255, 255, 255, .45);
}
.nex-profile-cta--ghost {
    flex: 1 1 100%;
    justify-content: center;
    background: transparent;
    color: var(--text-soft);
    box-shadow: none;
    border: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.nex-profile-cta-form {
    margin: 0;
    flex: 1 1 160px;
    display: flex;
}
.nex-profile-cta-form .nex-profile-cta {
    flex: 1;
    width: 100%;
}

.nex-profile-tabs--ref {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.nex-profile-tabs--ref .nex-profile-tab.is-active {
    border-bottom-color: var(--text);
}
.nex-profile-tab--soon {
    opacity: .42;
    cursor: default;
    pointer-events: none;
    border-bottom: 2px solid transparent;
}

.nex-profile-meta-inline {
    margin-top: 10px;
    font-size: .85rem;
}
.nex-profile-guest-hint {
    margin: 12px 0 10px;
}

@media (max-width: 640px) {
    .nex-profile-hero-inner {
        padding-left: 16px;
        padding-right: 16px;
    }
    .nex-profile-avatar-wrap {
        left: 16px;
    }
    .nex-avatar-hero.nex-avatar-img,
    .nex-avatar-hero.nex-avatar-letter {
        width: 92px;
        height: 92px;
    }
    .nex-avatar-hero.nex-avatar-letter {
        font-size: 1.9rem;
    }
    .nex-profile-cover--gradient,
    .nex-profile-cover.nex-profile-cover--img {
        min-height: 140px;
    }
}

.nex-card-soft {
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: inset 1px 1px 4px rgba(255, 255, 255, .5), inset -1px -1px 6px rgba(12, 22, 48, .05);
}
.nex-settings-section .nex-h2 { margin-top: 0; font-size: 1.05rem; }
.nex-settings-form { max-width: 640px; }

.nex-search-section { margin-bottom: 24px; }
.nex-search-user-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nex-search-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    font-weight: 600;
}

.nex-like-wrap { display: inline-flex; }
.nex-like-btn { margin: 0; }

/* ——— NEX лента: макет «Fests» (три колонки, soft UI) ——— */
body.nex-body--nex-soft {
    --fest-page-bg: #f5f7fa;
    --fest-card-radius: 18px;
    --fest-shadow: 8px 10px 28px rgba(15, 23, 42, .08), -4px -4px 16px rgba(255, 255, 255, .85);
    --fest-accent: #2563eb;
    background: var(--fest-page-bg) !important;
}
html.dark body.nex-body--nex-soft {
    --fest-page-bg: #0a0a0a;
    --fest-shadow: 8px 12px 32px rgba(0, 0, 0, .45);
    --fest-accent: #e5e5e5;
}

.nex-app--with-rail {
    grid-template-columns: 228px minmax(0, 1fr) 300px;
}
.nex-app--with-rail .nex-main-column {
    background: transparent;
    min-width: 0;
}
.nex-feed-rail {
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    border-left: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    background: color-mix(in srgb, var(--fest-page-bg, var(--bg)) 100%, transparent);
    padding: 20px 16px 28px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.nex-rail-hero {
    padding: 18px 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, .18), transparent 55%),
        linear-gradient(145deg, #ffffff 0%, color-mix(in srgb, var(--surface-soft) 100%, white) 100%);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}
html.dark .nex-rail-hero {
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .06), transparent 55%),
        linear-gradient(145deg, var(--surface) 0%, var(--surface-soft) 100%);
}
.nex-rail-hero-kicker {
    margin: 0 0 4px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
}
.nex-rail-hero-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
.nex-rail-hero-text {
    margin: 0;
    font-size: .84rem;
    line-height: 1.45;
    color: var(--text-soft);
}
.nex-rail-section-lead {
    margin: 0 0 12px;
    font-size: .78rem;
}
.nex-rail-photo-label {
    margin: 0 0 10px;
    font-size: .86rem;
    font-weight: 700;
    color: var(--text);
}
.nex-main--nex-screen {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 20px 56px;
    width: 100%;
}
.nex-main--friends.nex-main--nex-screen {
    max-width: min(1100px, 100%);
}
.nex-main--nex-screen .nex-flash,
.nex-main--nex-screen .nex-errors {
    max-width: 720px;
}

.nex-feed-screen-head {
    margin: 0 0 18px;
}
.nex-feed-fests-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
}
.nex-post-list--fest {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Левая колонка — nex + синий active */
.nex-sidebar--fest {
    padding: 22px 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: color-mix(in srgb, #ffffff 92%, var(--fest-page-bg, var(--bg)));
    border-right: none;
    box-shadow: 4px 0 24px rgba(15, 23, 42, .04);
}
html.dark .nex-sidebar--fest {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
}
.nex-sidebar-brand { margin-bottom: 24px; }
.nex-sidebar-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.nex-sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .4);
}
.nex-sidebar--fest .nex-sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    text-transform: lowercase;
    color: var(--text);
}
.nex-sidebar-nav--main { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.nex-sidebar-nav--extra { display: flex; flex-direction: column; gap: 4px; opacity: .92; }
.nex-sidebar-spacer { flex: 1; min-height: 32px; }
.nex-sidebar-footer {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.nex-side-link--fest {
    border-radius: 14px !important;
    padding: 11px 14px !important;
    font-size: .93rem;
    font-weight: 500;
    border: 1px solid transparent !important;
}
.nex-side-link--fest i {
    width: 1.25rem;
    text-align: center;
    opacity: .9;
    font-weight: 400;
}
.nex-sidebar--fest .nex-side-link--fest.is-active {
    background: var(--fest-accent, var(--accent)) !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-color: transparent !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .38);
}
.nex-sidebar--fest .nex-side-link--fest.is-active i {
    color: #fff;
    opacity: 1;
}
.nex-side-btn.nex-side-link--fest {
    border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--line)) !important;
}

/* Топ-бар ленты */
.nex-toolbar--feed {
    padding: 14px 22px;
    border-bottom: none;
    background: transparent;
    box-shadow: none;
}
.nex-toolbar--feed .nex-toolbar-search {
    flex: 1;
    max-width: min(560px, 100%);
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
    box-shadow: var(--fest-shadow);
}
html.dark .nex-toolbar--feed .nex-toolbar-search {
    background: var(--surface);
}

/* Топбар на профиле / настройках: как на ленте, но без строки поиска */
body.nex-body--nex-soft .nex-toolbar--fest:not(.nex-toolbar--feed) {
    padding: 14px 22px;
    border-bottom: none;
    background: transparent;
    box-shadow: none;
}
.nex-toolbar--no-search {
    gap: 12px;
}
body.nex-body--nex-soft .nex-main-column {
    background: transparent;
}

/* Профиль в том же soft-режиме, что и лента */
body.nex-body--nex-soft .nex-profile-hero {
    background: #fff;
    border-radius: var(--fest-card-radius, 20px);
    box-shadow: var(--fest-shadow);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}
html.dark body.nex-body--nex-soft .nex-profile-hero {
    background: var(--surface);
}
body.nex-body--nex-soft .nex-profile-banner-wrap {
    border-radius: var(--fest-card-radius, 18px);
    box-shadow: var(--fest-shadow);
    border-color: color-mix(in srgb, var(--line) 40%, transparent);
}
body.nex-body--nex-soft .nex-profile-card {
    background: #fff;
    border-radius: var(--fest-card-radius, 18px);
    box-shadow: var(--fest-shadow);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}
html.dark body.nex-body--nex-soft .nex-profile-card {
    background: var(--surface);
}
body.nex-body--nex-soft .nex-stat-card {
    background: var(--surface-soft);
    box-shadow: inset 2px 2px 6px rgba(255, 255, 255, .45), inset -2px -2px 8px rgba(12, 22, 48, .05);
}
body.nex-body--nex-soft .nex-profile-meta-sidebar {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}
body.nex-body--nex-soft .nex-post-card--compact {
    background: #fff;
    border-radius: var(--fest-card-radius, 18px);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
    box-shadow: var(--fest-shadow);
}
html.dark body.nex-body--nex-soft .nex-post-card--compact {
    background: var(--surface);
}

.nex-toolbar-faces {
    display: flex;
    align-items: center;
    padding-left: 4px;
}
.nex-toolbar-face {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    margin-left: -10px;
    border: 2px solid var(--fest-page-bg, var(--bg));
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.nex-toolbar-face:first-child { margin-left: 0; }
.nex-toolbar-face--solid {
    display: grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 800;
    color: #fff;
}
.nex-toolbar-face--g1 { background: linear-gradient(135deg, #ec4899, #a855f7); }
.nex-toolbar-face--g2 { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.nex-toolbar-face--g3 { background: linear-gradient(135deg, #f97316, #eab308); }

/* Карточка поста Fests */
.nex-post-card--fest {
    background: #fff;
    border-radius: var(--fest-card-radius);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
    box-shadow: var(--fest-shadow);
    padding: 16px 18px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
html.dark .nex-post-card--fest {
    background: var(--surface);
}
.nex-post-fest-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.nex-post-fest-author {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.nex-post-avatar-stack {
    position: relative;
    width: 48px;
    height: 44px;
    flex-shrink: 0;
}
.nex-avatar-fest.nex-avatar-img,
.nex-avatar-fest.nex-avatar-letter {
    width: 40px;
    height: 40px;
    position: absolute;
    left: 0;
    top: 2px;
    z-index: 2;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
html.dark .nex-avatar-fest.nex-avatar-img,
html.dark .nex-avatar-fest.nex-avatar-letter {
    border-color: var(--surface);
}
.nex-post-avatar-stack-ring {
    position: absolute;
    right: 0;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
    border: 2px solid #fff;
    z-index: 1;
}
html.dark .nex-post-avatar-stack-ring {
    border-color: var(--surface);
    background: linear-gradient(145deg, #2a2a2a, #3a3a3a);
}
.nex-post-fest-nameblock { min-width: 0; flex: 1; }
.nex-post-fest-name {
    display: block;
    font-weight: 700;
    font-size: .98rem;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.nex-post-fest-time {
    display: block;
    margin-top: 2px;
    font-size: .8rem;
    color: var(--text-soft);
}
.nex-post-menu--fest > summary.nex-post-menu-btn {
    width: 36px;
    height: 32px;
    border-radius: 10px;
}
.nex-body--nex-soft .nex-mature-badge--fest {
    margin: 0 0 10px;
}
.nex-post-card--fest > .nex-mature-badge--fest {
    align-self: flex-start;
}
.nex-post-body--fest {
    margin: 0 0 14px;
    line-height: 1.55;
    font-size: .95rem;
    white-space: pre-line;
    word-break: break-word;
    text-align: start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-inline: 0;
}
.nex-post-media-fest {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 -18px 14px;
}
.nex-post-img-fest {
    width: 100%;
    max-height: min(420px, 56vh);
    object-fit: cover;
    display: block;
    border-radius: 14px;
    background: #0f172a;
}
.nex-post-media-fest-link {
    display: block;
    margin: 0 18px;
    border-radius: 14px;
    overflow: hidden;
}
.nex-post-video-fest {
    width: calc(100% - 36px);
    margin: 0 18px;
    border-radius: 14px;
    max-height: min(420px, 56vh);
    background: #000;
}

.nex-post-fest-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding-top: 12px;
    margin: 0 -6px;
    border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
    align-items: center;
}
.nex-fest-act {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 6px;
    border: none;
    background: none;
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    border-radius: 12px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.nex-fest-act-row {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.nex-fest-act i {
    font-size: 1.15rem;
    line-height: 1;
}
/* fa-solid требует 900; общий font-weight:400 ломал ретвит и др. «solid»-иконки */
.nex-fest-act i.fa-solid {
    font-weight: 900 !important;
}
.nex-fest-act i.fa-regular {
    font-weight: 400 !important;
}
.nex-fest-act-num {
    font-size: .88rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-soft);
}
.nex-fest-act:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--text);
}
.nex-fest-act:hover:not(:disabled) .nex-fest-act-num {
    color: var(--text);
}
.nex-fest-act--like.is-active,
.nex-fest-act--like.is-active .nex-fest-act-num {
    color: #e11d48;
}
.nex-fest-act--like.is-active i { font-weight: 900; }
.nex-fest-act--muted { cursor: default; }
.nex-fest-act--disabled {
    opacity: .45;
    cursor: not-allowed;
}
.nex-fest-act--icononly .nex-fest-act-row {
    gap: 0;
}

/* Страница одного поста (референс: карточка + метрики + комментарии) */
.nex-post-single-ref {
    max-width: min(720px, 100%);
    margin: 0 auto;
}
.nex-post-single-shell {
    margin-bottom: 0;
}
.nex-post-fest-time {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}
.nex-post-fest-time-abs {
    font-weight: 500;
    color: var(--text-soft);
}
.nex-comments--ref {
    margin-top: 18px;
    padding: 18px 18px 16px;
    border-radius: var(--fest-card-radius, 18px);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
    background: #fff;
    box-shadow: var(--fest-shadow, 0 8px 28px rgba(12, 22, 48, .08));
}
html.dark .nex-comments--ref {
    background: var(--surface);
}
.nex-comments-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.03em;
}
.nex-comment-preview-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 12px;
}
.nex-comment-preview-faces {
    display: flex;
    align-items: center;
    padding-left: 4px;
}
.nex-avatar-comment-preview.nex-avatar-img,
.nex-avatar-comment-preview.nex-avatar-letter {
    width: 34px;
    height: 34px;
    margin-left: -12px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(12, 22, 48, .1);
    object-fit: cover;
    display: grid;
    place-items: center;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
}
html.dark .nex-avatar-comment-preview.nex-avatar-img,
html.dark .nex-avatar-comment-preview.nex-avatar-letter {
    border-color: var(--surface);
}
.nex-avatar-comment-preview:first-child {
    margin-left: 0;
}
.nex-comment-preview-lead {
    font-size: .86rem;
}

.nex-comment-form--ref {
    margin-bottom: 18px;
    max-width: 100%;
}
.nex-comment-form--ref .nex-comment-form-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.nex-comment-field {
    flex: 1 1 200px;
    min-width: 0;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    background: var(--surface-soft);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    line-height: 1.35;
    outline: none;
    resize: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}
.nex-comment-field:focus {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
    background: var(--surface);
}
.nex-comment-submit {
    flex-shrink: 0;
    padding: 12px 22px;
    border-radius: 14px;
    font-weight: 600;
    font-size: .92rem;
}
.nex-comments-login-hint {
    margin: 0 0 16px;
}
.nex-comment-list--ref {
    margin-top: 4px;
}

@media (max-width: 560px) {
    .nex-comment-form--ref .nex-comment-form-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .nex-comment-submit {
        width: 100%;
    }
}

/* Правая колонка */
.nex-rail-card {
    border-radius: var(--fest-card-radius);
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
    box-shadow: var(--fest-shadow);
    padding: 14px 16px;
}
html.dark .nex-rail-card {
    background: var(--surface);
}
.nex-rail-faces {
    display: flex;
    justify-content: center;
    gap: -8px;
    padding: 12px 8px;
    min-height: 52px;
    align-items: center;
}
.nex-rail-face {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    margin-left: -12px;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.nex-rail-face:first-child { margin-left: 0; }
.nex-rail-face--1 { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.nex-rail-face--2 { background: linear-gradient(135deg, #f472b6, #a855f7); }
.nex-rail-face--3 { background: linear-gradient(135deg, #34d399, #059669); }
.nex-rail-face--4 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.nex-rail-face--5 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.nex-rail-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.nex-rail-section-title {
    margin: 0;
    font-size: .86rem;
    font-weight: 700;
}
.nex-rail-expand {
    border: none;
    background: none;
    color: var(--text-soft);
    cursor: pointer;
    padding: 4px;
    opacity: .5;
}
.nex-rail-contact-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}
.nex-rail-avatar-link { flex: 1; display: flex; justify-content: center; }
.nex-rail-avatar.nex-avatar-img,
.nex-rail-avatar.nex-avatar-letter {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}
.nex-rail-avatar--placeholder {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
    border: 2px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.nex-rail-photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.nex-rail-photo-cell {
    aspect-ratio: 1;
    border-radius: 12px;
    display: block;
}
.nex-rail-photo-cell--a { background: linear-gradient(145deg, #93c5fd, #6366f1); }
.nex-rail-photo-cell--b { background: linear-gradient(145deg, #fcd34d, #f97316); }
.nex-rail-photo-cell--c { background: linear-gradient(145deg, #6ee7b7, #0d9488); }
.nex-rail-photo-cell--d { background: linear-gradient(145deg, #fbcfe8, #db2777); }

.nex-rail-trends-label {
    margin: 0 0 8px;
    font-size: .86rem;
    font-weight: 700;
}
.nex-rail-trends-card {
    border-radius: 14px;
    min-height: 120px;
    background:
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, .35), transparent 45%),
        linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0b1220 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    position: relative;
    overflow: hidden;
}
.nex-rail-trends-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    margin-bottom: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .5);
}
.nex-rail-trends-text {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}
.nex-rail-trends-card--link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    gap: 6px;
}
.nex-rail-trends-card--link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);
}
.nex-rail-trends-go {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    color: rgba(226, 232, 240, 0.75) !important;
}

/* Слайдер изображений в посте (Swiper) */
.nex-post-swiper {
    position: relative;
    width: calc(100% - 36px);
    margin: 0 18px 10px;
    border-radius: 14px;
    overflow: hidden;
    --swiper-pagination-color: var(--accent);
    --swiper-pagination-bullet-inactive-opacity: 0.35;
}
.nex-post-swiper .swiper-pagination-bullets {
    bottom: 10px;
}
.nex-post-swiper-link {
    display: block;
    line-height: 0;
    background: #0f172a;
}
.nex-post-img-fest--slide {
    width: 100%;
    max-height: min(420px, 56vh);
    object-fit: cover;
    display: block;
}
/* Страница контактов */
.nex-friends-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
    width: 100%;
}
.nex-friends-main {
    min-width: 0;
}
.nex-friends-screen-head {
    margin: 0 0 14px;
}
.nex-friends-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
    background: #fff;
    box-shadow: var(--fest-shadow, 0 4px 18px rgba(15, 23, 42, 0.06));
    margin-bottom: 14px;
}
html.dark .nex-friends-search-bar {
    background: var(--surface);
}
.nex-friends-search-icon {
    color: var(--text-soft);
    font-size: 0.95rem;
}
.nex-friends-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
}
.nex-friends-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.nex-friends-tab {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-soft);
    background: color-mix(in srgb, var(--surface-soft) 90%, transparent);
    border: 1px solid transparent;
}
.nex-friends-tab.is-active {
    color: var(--text);
    background: #fff;
    border-color: color-mix(in srgb, var(--line) 55%, transparent);
    box-shadow: var(--fest-shadow, 0 4px 14px rgba(15, 23, 42, 0.06));
}
html.dark .nex-friends-tab.is-active {
    background: var(--surface);
}
.nex-friends-tab--soon {
    opacity: 0.42;
    cursor: default;
}
.nex-friends-card-block {
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: var(--fest-card-radius, 18px);
}
.nex-friends-card-block--no-pad {
    padding-bottom: 12px;
}
.nex-friends-card-h {
    margin: 0 0 12px;
    font-size: 0.92rem;
    font-weight: 700;
}
.nex-friends-card-h--pad {
    padding: 0 0 0 2px;
}
.nex-friends-add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.nex-friends-add-form .nex-input {
    flex: 1 1 200px;
    min-width: 0;
}
.nex-friends-empty {
    margin: 20px 0;
}
.nex-friends-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 640px) {
    .nex-friends-grid {
        grid-template-columns: 1fr;
    }
}
.nex-friend-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
    background: #fff;
    box-shadow: var(--fest-shadow, 0 6px 20px rgba(15, 23, 42, 0.06));
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
html.dark .nex-friend-tile {
    background: var(--surface);
}
.nex-friend-tile.is-selected {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
    box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 12%, transparent);
}
.nex-friend-tile-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    text-decoration: none;
    color: inherit;
}
.nex-avatar-friend-tile.nex-avatar-img,
.nex-avatar-friend-tile.nex-avatar-letter {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}
html.dark .nex-avatar-friend-tile.nex-avatar-img,
html.dark .nex-avatar-friend-tile.nex-avatar-letter {
    border-color: var(--surface);
}
.nex-friend-tile-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.nex-friend-tile-name {
    font-weight: 700;
    font-size: 0.93rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nex-friend-tile-meta {
    font-size: 0.78rem;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 6px;
}
.nex-friend-tile-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
    flex-shrink: 0;
}
.nex-friend-tile-dm {
    margin: 0;
    flex-shrink: 0;
}
.nex-friend-tile-dm-btn {
    border-radius: 12px;
    white-space: nowrap;
}

.nex-friends-detail {
    position: sticky;
    top: 16px;
    align-self: start;
    width: 300px;
    max-width: 100%;
}
.nex-friends-detail-card {
    border-radius: var(--fest-card-radius, 20px);
    border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
    background: #fff;
    box-shadow: var(--fest-shadow);
    padding: 22px 18px 20px;
}
html.dark .nex-friends-detail-card {
    background: var(--surface);
}
.nex-friends-detail-card--empty {
    padding: 28px 16px;
    text-align: center;
    line-height: 1.5;
}
.nex-friends-detail-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}
.nex-avatar-friend-detail.nex-avatar-img,
.nex-avatar-friend-detail.nex-avatar-letter {
    width: 112px;
    height: 112px;
    border-radius: 999px;
    border: 4px solid #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
}
html.dark .nex-avatar-friend-detail.nex-avatar-img,
html.dark .nex-avatar-friend-detail.nex-avatar-letter {
    border-color: var(--surface);
}
.nex-friends-detail-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.nex-friends-detail-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
}
.nex-friends-detail-profile-link {
    color: var(--accent);
    padding: 6px;
    border-radius: 10px;
}
.nex-friends-detail-profile-link:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.nex-friends-detail-bio {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}
.nex-friends-detail-sub {
    margin: 0 0 16px;
    font-size: 0.82rem;
    text-align: center;
}
.nex-friends-detail-files-label {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-soft);
}
.nex-friends-detail-files-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed color-mix(in srgb, var(--line) 65%, transparent);
    font-size: 0.84rem;
    margin-bottom: 18px;
}
.nex-friends-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.nex-friends-detail-form {
    margin: 0;
}
.nex-friends-detail-btn-full {
    width: 100%;
    justify-content: center;
    border-radius: 14px;
    padding: 12px 16px;
}
.nex-friends-detail-files-cta {
    display: flex;
    justify-content: center;
    width: 100%;
    border-radius: 14px;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: 600;
}
@media (max-width: 1024px) {
    .nex-friends-page {
        grid-template-columns: 1fr;
    }
    .nex-friends-detail {
        position: static;
        width: 100%;
    }
}

@media (max-width: 1180px) {
    .nex-app--with-rail {
        grid-template-columns: 212px minmax(0, 1fr);
    }
    .nex-feed-rail {
        display: none !important;
    }
}
@media (max-width: 1024px) {
    .nex-app--with-rail {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .nex-post-fest-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nex-toolbar--feed .nex-toolbar-faces {
        display: none;
    }
}

/* Topbar поиск — выпадающие подсказки */
.nex-toolbar-search-shell {
    position: relative;
    flex: 1;
    max-width: min(440px, 52vw);
    min-width: 0;
}
.nex-toolbar-search-shell .nex-toolbar-search {
    max-width: none;
    width: 100%;
}
.nex-search-suggest {
    position: absolute;
    z-index: 60;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(10, 15, 29, 0.18);
    padding: 12px;
}
html.dark .nex-search-suggest {
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.45);
}
.nex-search-dd-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    margin: 4px 2px 8px;
}
.nex-search-dd-ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}
.nex-search-dd-ul:last-child {
    margin-bottom: 4px;
}
.nex-search-dd-row {
    display: grid;
    gap: 4px;
    padding: 10px 10px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
}
.nex-search-dd-row:hover {
    background: var(--surface-soft);
}
.nex-search-dd-row--static:hover {
    background: transparent;
}
.nex-search-dd-row-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}
.nex-search-dd-sub {
    font-size: 0.78rem;
    line-height: 1.3;
}
.nex-search-dd-muted {
    font-size: 0.82rem;
    padding: 8px;
    color: var(--text-soft);
}

@media (max-width: 520px) {
    .nex-toolbar-search-shell {
        max-width: none;
    }
}

.nex-radio-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.nex-account-admin .btn {
    width: 100%;
    justify-self: stretch;
}

/* Swiper поста — стрелки */
.nex-post-swiper .swiper-button-prev,
.nex-post-swiper .swiper-button-next {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.45);
    color: #fff;
    border: none;
}
.nex-post-swiper .swiper-button-prev::after,
.nex-post-swiper .swiper-button-next::after {
    font-size: 16px;
    font-weight: 800;
}

/* Админка NEX */
.nex-admin {
    margin-top: 8px;
}
.nex-admin-topnav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.nex-admin-topnav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.87rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--line);
    color: var(--text-soft);
}
.nex-admin-topnav-link.is-active {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.nex-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.nex-admin-stat {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    background: var(--surface-soft);
}
.nex-admin-stat-num {
    font-size: 1.85rem;
    font-weight: 800;
}
.nex-admin-stat-label {
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-top: 4px;
}
.nex-admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.nex-admin-tabs a {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--line);
    color: var(--text-soft);
}
.nex-admin-tabs a.is-active {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    color: var(--accent);
}
.nex-admin-table-wrap {
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    overflow-x: auto;
    background: var(--surface-soft);
}
.nex-admin-card {
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    background: var(--surface-soft);
    padding: 16px;
    margin-bottom: 14px;
}
.nex-admin-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: flex-end;
}
.nex-admin-form-row select,
.nex-admin-form-row textarea,
.nex-admin-form-row button {
    font: inherit;
}
.nex-admin-form-row textarea {
    flex: 1 1 200px;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 8px;
    background: var(--surface);
    resize: vertical;
}
.nex-admin-form-row select {
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 8px;
    background: var(--surface);
}

/* === UNLIAS: колокол уведомлений + FA в сайдбаре/тулбаре (.nex-side-link { font: inherit } ломало глифы) === */
.nex-side-link > i[class*="fa-"],
.nex-side-link--fest > i[class*="fa-"],
.nex-toolbar i[class*="fa-"],
.nex-toolbar .unlias-notif-btn i[class*="fa-"] {
    font-family: "Font Awesome 6 Free" !important;
    font-style: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}
.nex-side-link > i.fa-regular,
.nex-side-link--fest > i.fa-regular,
.nex-toolbar i.fa-regular,
.nex-toolbar .unlias-notif-btn .fa-regular {
    font-weight: 400 !important;
}
.nex-side-link > i.fa-solid,
.nex-side-link--fest > i.fa-solid,
.nex-toolbar i.fa-solid {
    font-weight: 900 !important;
}
.nex-side-link > i.fa-brands,
.nex-toolbar i.fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}
.nex-toolbar-face--photo {
    padding: 0;
    overflow: hidden;
    background: transparent !important;
}
.nex-toolbar-face--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}
.avatar-chip-img-tb {
    border-radius: 999px;
    object-fit: cover;
    display: block;
}
.avatar-chip.avatar-btn:has(.avatar-chip-img-tb:not(.avatar-chip-img-tb--lg)) {
    padding: 0;
    overflow: hidden;
    background: transparent !important;
}
.avatar-chip.avatar-btn .avatar-chip-img-tb:not(.avatar-chip-img-tb--lg) {
    width: 100%;
    height: 100%;
}
.avatar-chip.avatar-btn .avatar-chip-img-tb--lg {
    width: 40px;
    height: 40px;
}

.unlias-notif-hub {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}
.unlias-notif-hub .unlias-notif-btn {
    position: relative;
    padding: 0;
    font: inherit;
}
.nex-toolbar .unlias-notif-btn.icon-btn {
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.nex-toolbar .unlias-notif-btn.icon-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.unlias-notif-count {
    position: absolute;
    bottom: -2px;
    right: -4px;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1rem;
    text-align: center;
    background: #ef4444;
    color: #fff;
    border: 2px solid var(--surface);
    box-sizing: border-box;
}
html.dark .unlias-notif-count {
    border-color: var(--surface);
}
.unlias-notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, 92vw);
    max-height: min(420px, 70vh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 200;
}
/* Важно: иначе display:flex перебивает атрибут hidden и панель «залипает» открытой */
.unlias-notif-panel[hidden] {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}
.unlias-notif-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: 0.92rem;
}
.unlias-notif-readall {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    color: var(--text-soft);
}
.unlias-notif-list {
    overflow: auto;
    flex: 1;
    padding: 8px 6px 10px;
}
.unlias-notif-empty {
    padding: 12px;
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
}
.unlias-notif-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font: inherit;
    background: transparent;
    color: inherit;
    margin-bottom: 4px;
}
.unlias-notif-item:hover {
    background: var(--surface-soft);
}
.unlias-notif-item.is-read {
    opacity: 0.65;
}
.unlias-notif-title {
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%;
}
.unlias-notif-body {
    font-size: 0.82rem;
    line-height: 1.35;
    width: 100%;
}
.unlias-notif-foot {
    padding: 8px 14px 10px;
    font-size: 0.78rem;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
}
.unlias-notif-foot a {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.unlias-notif-foot a:hover {
    text-decoration: underline;
}

.nex-notif-list-page {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nex-notif-row {
    border-radius: var(--radius-md, 14px);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
}
.nex-notif-row.is-read {
    opacity: 0.72;
}
.nex-notif-row-link,
.nex-notif-row-static {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    width: 100%;
    background: transparent;
    border: none;
    font: inherit;
    cursor: default;
    text-align: left;
}
.nex-notif-row-link {
    cursor: pointer;
}
.nex-notif-row-link:hover {
    background: var(--surface-soft);
}
.nex-notif-row-title {
    font-weight: 600;
}
.nex-notif-row-body {
    font-size: 0.88rem;
    line-height: 1.35;
}
.nex-notif-row-time {
    font-size: 0.78rem;
}
.nex-notif-empty.nex-card-soft {
    margin-top: 8px;
}
.nex-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.nex-pagination a {
    color: var(--accent);
    font-weight: 600;
}

/* ——— Мобильная навигация, touch 44px+, узкие экраны (до ~350px) ——— */
body.nex-body .nex-toolbar .icon-btn,
body.nex-body .nex-sidebar-toggle,
body.nex-body .nex-toolbar .theme-toggle {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
}
body.nex-body .nex-toolbar .avatar-chip,
body.nex-body .nex-toolbar .avatar-btn {
    min-width: 44px;
    min-height: 44px;
}

.nex-mobile-tabbar {
    display: none;
}
@media (max-width: 639px) {
    .nex-mobile-tabbar {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: stretch;
        gap: 4px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 55;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        background: color-mix(in srgb, var(--surface) 96%, var(--fest-page-bg, var(--bg)));
        border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        -webkit-tap-highlight-color: transparent;
    }
    html.dark body.nex-body .nex-mobile-tabbar {
        background: color-mix(in srgb, var(--surface) 94%, #0b0f14);
        box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
    }
    .nex-body--nex-soft .nex-main--nex-screen {
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }
    .nex-mtab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 48px;
        padding: 6px 4px;
        border-radius: 12px;
        font-size: 0.65rem;
        font-weight: 600;
        color: var(--text-soft);
        text-decoration: none;
        border: none;
        background: transparent;
        font-family: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .nex-mtab i {
        font-size: 1.14rem;
        line-height: 1;
    }
    .nex-mtab.is-active {
        color: var(--fest-accent, var(--accent));
    }
}

@media (max-width: 400px) {
    .nex-main--nex-screen {
        padding-left: 12px;
        padding-right: 12px;
    }
    .nex-post-card--fest {
        padding: 12px 12px 10px;
        border-radius: 14px;
    }
    .nex-post-media-fest {
        margin-left: -12px;
        margin-right: -12px;
    }
    .nex-post-swiper {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
    }
    .nex-post-media-fest-link {
        margin-left: 12px;
        margin-right: 12px;
    }
    .nex-post-video-fest {
        margin-left: 12px;
        margin-right: 12px;
        width: calc(100% - 24px);
    }
    .nex-post-fest-actions {
        gap: 2px;
        margin-left: -4px;
        margin-right: -4px;
    }
    .nex-fest-act {
        padding: 10px 4px;
        min-height: 44px;
    }
    .nex-feed-fests-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .nex-toolbar {
        padding-inline: 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .nex-toolbar--feed .nex-toolbar-faces {
        display: none;
    }
}

@media (max-width: 350px) {
    .nex-main--nex-screen {
        padding-left: 10px;
        padding-right: 10px;
    }
    body.nex-body .nex-toolbar .nex-toolbar-dropdown:last-of-type {
        margin-inline-start: auto;
    }
}

html.dark .nex-sidebar-brand-icon {
    background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}

html.dark .nex-rail-face--1 {
    background: linear-gradient(135deg, #6b6b6b, #3a3a3a);
}

html.dark .nex-rail-photo-cell--a {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
}

html.dark .nex-rail-trends-card {
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .06), transparent 45%),
        linear-gradient(160deg, #141414 0%, #1a1a1a 50%, #0a0a0a 100%);
}

html.dark .nex-rail-trends-mark {
    background: linear-gradient(135deg, #5a5a5a, #3a3a3a);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}

html.dark .nex-post-swiper-link,
html.dark .nex-post-img-fest {
    background: #111111;
}

html.dark .unlias-user-mention {
    color: #d6d6d6;
}

html.dark .nex-profile-cover--gradient {
    background: linear-gradient(118deg, #141414 0%, #242424 42%, #3a3a3a 100%);
}

.unlias-profile-blocked {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(60vh, 520px);
    padding: 32px 20px;
}

.unlias-profile-blocked__card {
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 36px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.unlias-profile-blocked__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-soft);
    color: #ef4444;
    font-size: 1.35rem;
}

.unlias-profile-blocked__title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 700;
}

.unlias-profile-blocked__text {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}
