/* ============================================================
   NEWS.CSS — раздел «Новости» (news-frontend)
   Тёмная космическая тема, префикс nw-. Базируется на
   переменных и общих классах main.css / ui.css.
   Адаптив: 900px, 640px. Без горизонтального скролла.
   ============================================================ */

/* ---------- Общее ---------- */
.nw-page {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.nw-page *,
.nw-page *::before,
.nw-page *::after {
    min-width: 0;
}

.nw-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ui-muted);
}

.nw-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;
}

/* ============================================================
   HERO ленты
   ============================================================ */
.nw-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    padding: 46px 42px;
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    background:
        radial-gradient(760px 280px at 8% -20%, rgba(108, 60, 225, 0.38), transparent 62%),
        radial-gradient(620px 240px at 100% 120%, rgba(74, 144, 217, 0.28), transparent 60%),
        linear-gradient(160deg, rgba(20, 20, 52, 0.96), rgba(9, 9, 26, 0.92));
    box-shadow: var(--ui-shadow), var(--ui-glow);
    isolation: isolate;
}

.nw-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(1.6px 1.6px at 18% 28%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1.4px 1.4px at 42% 72%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.8px 1.8px at 67% 22%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(1.2px 1.2px at 82% 64%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 92% 18%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1.3px 1.3px at 30% 90%, rgba(255, 255, 255, 0.55), transparent);
    opacity: 0.85;
    pointer-events: none;
}

.nw-hero::after {
    content: '';
    position: absolute;
    right: -130px;
    top: -140px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    border: 1px solid rgba(168, 85, 247, 0.28);
    box-shadow:
        0 0 0 44px rgba(168, 85, 247, 0.05),
        0 0 0 96px rgba(108, 60, 225, 0.04),
        0 0 0 150px rgba(74, 144, 217, 0.03);
    pointer-events: none;
}

.nw-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

.nw-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: rgba(108, 60, 225, 0.16);
    color: #d9c9ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.nw-hero-title {
    margin: 16px 0 10px;
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -1.2px;
    overflow-wrap: anywhere;
}

.nw-hero-title span {
    background: linear-gradient(135deg, #c4a5ff, #4a90d9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nw-hero-sub {
    max-width: 540px;
    color: var(--ui-muted);
    font-size: 15px;
    line-height: 1.6;
}

.nw-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.nw-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nw-hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nw-hero-stat b {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.nw-hero-stat span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ui-dim);
}

/* ============================================================
   Фильтр: категории + поиск
   ============================================================ */
.nw-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.nw-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.nw-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nw-cat:hover {
    color: #fff;
    border-color: var(--ui-accent-2);
    background: rgba(168, 85, 247, 0.1);
}

.nw-cat.active {
    color: #fff;
    border-color: rgba(168, 85, 247, 0.6);
    background: rgba(108, 60, 225, 0.3);
    box-shadow: 0 0 18px rgba(108, 60, 225, 0.25);
}

.nw-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 250px;
    max-width: 350px;
}

.nw-search-input {
    width: 100%;
    padding: 10px 46px 10px 15px;
    border-radius: 999px;
    border: 1px solid var(--ui-border);
    background: rgba(5, 5, 18, 0.6);
    color: #fff;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.nw-search-input::placeholder {
    color: var(--ui-dim);
}

.nw-search-input:focus {
    border-color: var(--ui-accent-2);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
}

.nw-search-btn {
    position: absolute;
    right: 4px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.nw-search-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(108, 60, 225, 0.4);
}

.nw-filter-note {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--ui-dim);
    font-size: 12.5px;
}

.nw-filter-note b {
    color: var(--ui-muted);
}

/* ============================================================
   Сетка и карточки ленты
   ============================================================ */
.nw-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.nw-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    background: var(--ui-bg);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.nw-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5), 0 0 26px rgba(108, 60, 225, 0.16);
}

.nw-card--pinned {
    border-color: rgba(255, 215, 0, 0.32);
}

.nw-card-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 25%, rgba(168, 85, 247, 0.4), transparent 55%),
        radial-gradient(circle at 78% 80%, rgba(74, 144, 217, 0.35), transparent 55%),
        #101028;
}

.nw-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.nw-card:hover .nw-card-cover img {
    transform: scale(1.05);
}

.nw-card-cover-orbit {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    opacity: 0.85;
    text-shadow: 0 0 28px rgba(168, 85, 247, 0.65);
}

.nw-card-cat {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(168, 85, 247, 0.5);
    background: rgba(12, 10, 34, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #e2d6ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nw-card-pin {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.14);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #ffe98a;
    font-size: 11px;
    font-weight: 700;
}

.nw-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px 18px;
}

.nw-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    transition: color 0.18s ease;
}

.nw-card-title:hover {
    color: #cdb8ff;
}

.nw-card-title:focus-visible {
    outline: 2px solid var(--ui-accent-2);
    outline-offset: 3px;
    border-radius: 4px;
}

.nw-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    color: var(--ui-muted);
    font-size: 13.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.nw-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--ui-dim);
    font-size: 12px;
}

.nw-card-meta-sep {
    color: rgba(255, 255, 255, 0.2);
}

.nw-author {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
}

.nw-author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    background: linear-gradient(135deg, rgba(108, 60, 225, 0.55), rgba(74, 144, 217, 0.55));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.nw-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nw-author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
    color: var(--ui-muted);
    font-weight: 600;
    font-size: 12px;
}

a.nw-author:hover .nw-author-name {
    color: #fff;
}

.nw-card-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--ui-border-soft);
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 600;
}

.nw-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nw-card-stat-icon {
    font-size: 13px;
    line-height: 1;
}

/* ============================================================
   Пустые состояния и пагинация
   ============================================================ */
.nw-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 56px 20px;
    text-align: center;
    border: 1px dashed var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: rgba(255, 255, 255, 0.02);
}

.nw-empty-icon {
    font-size: 52px;
    line-height: 1;
    animation: nwFloat 3s ease-in-out infinite;
}

@keyframes nwFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.nw-empty-title {
    font-size: 18px;
    font-weight: 700;
}

.nw-empty-text {
    max-width: 420px;
    color: var(--ui-muted);
    font-size: 14px;
    line-height: 1.6;
}

.nw-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 26px;
}

.nw-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nw-pager-btn:hover {
    color: #fff;
    border-color: var(--ui-accent-2);
    background: rgba(168, 85, 247, 0.1);
}

.nw-pager-btn.active {
    color: #fff;
    border-color: transparent;
    background: var(--accent-gradient);
    box-shadow: 0 6px 18px rgba(108, 60, 225, 0.35);
}

.nw-pager-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nw-pager-dots {
    padding: 0 4px;
    color: var(--ui-dim);
    font-size: 13px;
}

/* ============================================================
   Хлебные крошки / детальная страница
   ============================================================ */
.nw-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--ui-dim);
    font-size: 13px;
}

.nw-crumbs a {
    color: var(--ui-muted);
    font-weight: 600;
}

.nw-crumbs a:hover {
    color: #fff;
}

.nw-crumb-sep {
    color: rgba(255, 255, 255, 0.22);
}

.nw-crumb-current {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ui-muted);
}

.nw-editor-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 14px;
}

.nw-article {
    overflow: hidden;
    min-width: 0;
}

.nw-article-cover {
    max-height: 440px;
    overflow: hidden;
    background: #101028;
}

.nw-article-cover img {
    width: 100%;
    max-height: 440px;
    object-fit: cover;
}

.nw-article-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px 32px 0;
}

.nw-article-chip {
    align-self: flex-start;
}

.nw-article-pin {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.1);
    color: #ffe98a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nw-article-title {
    margin: 0;
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.6px;
    overflow-wrap: anywhere;
}

.nw-article-excerpt {
    margin: 0;
    color: var(--ui-muted);
    font-size: 16px;
    line-height: 1.62;
    overflow-wrap: anywhere;
}

.nw-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ui-border-soft);
    color: var(--ui-dim);
    font-size: 13px;
}

.nw-article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nw-article-meta-item b {
    color: var(--ui-muted);
    font-weight: 600;
}

.nw-article-body {
    padding: 22px 32px 8px;
    overflow-wrap: anywhere;
}

.nw-article-body:empty {
    display: none;
}

.nw-article-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 18px 32px 26px;
    border-top: 1px solid var(--ui-border-soft);
}

.nw-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    color: var(--ui-muted);
    font-size: 13.5px;
    font-weight: 600;
}

.nw-back:hover {
    color: #fff;
}

/* ============================================================
   Rich-контент новости
   ============================================================ */
.nw-rich {
    color: #d8d8ef;
    font-size: 15.5px;
    line-height: 1.75;
}

.nw-rich > *:first-child {
    margin-top: 0;
}

.nw-rich > *:last-child {
    margin-bottom: 0;
}

.nw-rich p {
    margin: 0 0 1em;
}

.nw-rich h1,
.nw-rich h2,
.nw-rich h3,
.nw-rich h4,
.nw-rich h5,
.nw-rich h6 {
    margin: 1.5em 0 0.6em;
    color: #fff;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.nw-rich h1 { font-size: 1.7em; }
.nw-rich h2 { font-size: 1.45em; }
.nw-rich h3 { font-size: 1.22em; }
.nw-rich h4 { font-size: 1.08em; }
.nw-rich h5,
.nw-rich h6 { font-size: 1em; }

.nw-rich a {
    color: #b79bff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nw-rich a:hover {
    color: #d5c4ff;
}

.nw-rich ul,
.nw-rich ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

.nw-rich li {
    margin: 0.3em 0;
}

.nw-rich blockquote {
    margin: 1.2em 0;
    padding: 12px 18px;
    border-left: 3px solid var(--ui-accent-2);
    border-radius: 0 12px 12px 0;
    background: rgba(168, 85, 247, 0.08);
    color: #cfc8ea;
}

.nw-rich code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ui-border-soft);
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.9em;
    color: #e3d8ff;
}

.nw-rich pre {
    margin: 1.2em 0;
    padding: 14px 16px;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(3, 3, 12, 0.7);
    font-size: 13px;
    line-height: 1.6;
}

.nw-rich pre code {
    padding: 0;
    border: none;
    background: transparent;
    color: #d8d8ef;
}

.nw-rich img {
    max-width: 100%;
    height: auto;
    margin: 1.2em 0;
    border-radius: 12px;
    border: 1px solid var(--ui-border-soft);
}

.nw-rich figure {
    margin: 1.2em 0;
}

.nw-rich figcaption {
    margin-top: 6px;
    color: var(--ui-dim);
    font-size: 12.5px;
    text-align: center;
}

.nw-rich hr {
    margin: 1.6em 0;
    border: none;
    border-top: 1px solid var(--ui-border-soft);
}

.nw-rich table {
    width: 100%;
    max-width: 100%;
    margin: 1.2em 0;
    border-collapse: collapse;
    font-size: 14px;
    display: block;
    overflow-x: auto;
}

.nw-rich th,
.nw-rich td {
    padding: 8px 12px;
    border: 1px solid var(--ui-border-soft);
    text-align: left;
}

.nw-rich th {
    background: rgba(108, 60, 225, 0.14);
    color: #fff;
}

.nw-rich s,
.nw-rich strike {
    color: var(--ui-muted);
}

/* ============================================================
   Галерея и прикреплённые ссылки (детальная)
   ============================================================ */
.nw-gallery,
.nw-att-links {
    padding: 6px 32px 12px;
}

.nw-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.nw-section-title span {
    font-size: 14px;
}

.nw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.nw-gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--ui-border-soft);
    background: #0a0a1e;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.nw-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nw-gallery-item:hover {
    border-color: var(--ui-accent-2);
}

.nw-gallery-item:hover img {
    transform: scale(1.05);
}

.nw-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nw-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.03);
    font-size: 13.5px;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.nw-link:hover {
    border-color: var(--ui-accent-2);
    background: rgba(168, 85, 247, 0.08);
}

.nw-link-icon {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 1;
}

.nw-link-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-weight: 600;
}

.nw-link-host {
    flex: 0 1 auto;
    margin-left: auto;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ui-dim);
    font-size: 11.5px;
}

/* ============================================================
   Реакции, просмотры, поделиться
   ============================================================ */
.nw-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nw-reactions-label {
    margin-right: 2px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.nw-react {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nw-react:hover {
    color: #fff;
    border-color: var(--ui-accent-2);
}

.nw-react.active {
    color: #fff;
    border-color: rgba(168, 85, 247, 0.65);
    background: rgba(168, 85, 247, 0.18);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.22);
}

.nw-react.pop {
    animation: nwPop 0.3s ease;
}

@keyframes nwPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.16); }
    100% { transform: scale(1); }
}

.nw-react-emoji {
    font-size: 15px;
    line-height: 1;
}

.nw-react-count {
    font-variant-numeric: tabular-nums;
}

.nw-react-total {
    color: var(--ui-dim);
    font-size: 12px;
}

.nw-react-total b {
    color: var(--ui-muted);
}

.nw-article-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.nw-views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 600;
}

/* ============================================================
   Редактор
   ============================================================ */
.nw-editor-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.nw-editor-title {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.nw-editor-sub {
    margin-top: 6px;
    color: var(--ui-muted);
    font-size: 13.5px;
}

.nw-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}

.nw-editor-main,
.nw-editor-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.nw-form-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.nw-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.nw-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.nw-label-hint {
    color: var(--ui-dim);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.nw-req {
    color: #ff9a9a;
}

.nw-hint {
    color: var(--ui-dim);
    font-size: 12px;
    line-height: 1.5;
}

.nw-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.nw-editor-page .ui-input,
.nw-editor-page .ui-textarea,
.nw-editor-page .ui-select {
    background: rgba(5, 5, 18, 0.72);
}

.nw-editor-page .ui-textarea {
    min-height: 96px;
    line-height: 1.55;
}

.nw-editor-wrap {
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(5, 5, 18, 0.72);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.nw-editor-wrap:focus-within {
    border-color: var(--ui-accent-2);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
}

.nw-editor-fallback {
    width: 100%;
    min-height: 320px;
    padding: 14px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

/* --- Обложка --- */
.nw-cover-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
}

.nw-cover-preview {
    position: relative;
    flex: 0 0 240px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    border: 1px dashed var(--ui-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--ui-dim);
    font-size: 12px;
    text-align: center;
}

.nw-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nw-cover-actions {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
}

.nw-cover-empty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- Галерея редактора --- */
.nw-gallery-editor {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.nw-gallery-item--sm {
    aspect-ratio: 1 / 1;
}

.nw-gallery-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(5, 5, 18, 0.82);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nw-gallery-remove:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.9);
}

.nw-gallery-empty {
    padding: 18px;
    text-align: center;
    color: var(--ui-dim);
    font-size: 12.5px;
    border: 1px dashed var(--ui-border-soft);
    border-radius: 12px;
}

/* --- Ссылки редактора --- */
.nw-links-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nw-links-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nw-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 38px;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.nw-link-remove {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #ff9a9a;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.nw-link-remove:hover {
    background: rgba(239, 68, 68, 0.22);
}

/* --- Карточка публикации --- */
.nw-publish-card {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nw-aside-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.nw-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--ui-muted);
}

.nw-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ui-muted);
    font-size: 11.5px;
    font-weight: 700;
}

.nw-status-chip.is-published {
    color: #7ef0a5;
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.1);
}

.nw-status-chip.is-draft {
    color: #ffd27a;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.1);
}

.nw-switch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.nw-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.nw-switch-track {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    margin-top: 2px;
    border-radius: 999px;
    border: 1px solid var(--ui-border);
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.nw-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #9a9ac0;
    transition: transform 0.2s ease, background 0.2s ease;
}

.nw-switch input:checked + .nw-switch-track {
    border-color: rgba(168, 85, 247, 0.65);
    background: rgba(108, 60, 225, 0.55);
}

.nw-switch input:checked + .nw-switch-track .nw-switch-thumb {
    transform: translateX(18px);
    background: #fff;
}

.nw-switch input:focus-visible + .nw-switch-track {
    outline: 2px solid var(--ui-accent-2);
    outline-offset: 2px;
}

.nw-switch-text {
    min-width: 0;
    color: var(--ui-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

.nw-switch-text b {
    display: block;
    margin-bottom: 2px;
    color: #fff;
    font-size: 13.5px;
}

.nw-publish-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.nw-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nw-tips li {
    display: flex;
    gap: 9px;
    color: var(--ui-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.nw-tips li b {
    color: #fff;
}

.nw-tip-icon {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 1.3;
}

/* --- Загрузка: перетаскивание --- */
.nw-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 16px;
    border: 1px dashed var(--ui-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--ui-muted);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.nw-dropzone:hover,
.nw-dropzone.is-drag {
    border-color: var(--ui-accent-2);
    background: rgba(168, 85, 247, 0.08);
}

.nw-dropzone-icon {
    font-size: 24px;
    line-height: 1;
}

.nw-dropzone-hint {
    color: var(--ui-dim);
    font-size: 11.5px;
}

.nw-upload-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nwSpin 0.7s linear infinite;
    vertical-align: -2px;
}

@keyframes nwSpin {
    to { transform: rotate(360deg); }
}

.nw-gallery-item.is-uploading {
    opacity: 0.55;
}

/* ============================================================
   Quill 2.0.2 — тёмная тема
   ============================================================ */
.nw-editor-page .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid var(--ui-border);
    background: rgba(9, 9, 26, 0.85);
    padding: 8px 10px;
}

.nw-editor-page .ql-container.ql-snow {
    border: none;
    background: transparent;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
}

.nw-editor-page .ql-editor {
    min-height: 320px;
    max-height: 62vh;
    overflow-y: auto;
    color: #d8d8ef;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.nw-editor-page .ql-editor.ql-blank::before {
    color: var(--ui-dim);
    font-style: normal;
}

.nw-editor-page .ql-editor a {
    color: #b79bff;
}

.nw-editor-page .ql-editor img {
    max-width: 100%;
    border-radius: 10px;
}

.nw-editor-page .ql-snow .ql-stroke {
    stroke: #9a9ac0;
}

.nw-editor-page .ql-snow .ql-fill {
    fill: #9a9ac0;
}

.nw-editor-page .ql-snow .ql-picker {
    color: #9a9ac0;
}

.nw-editor-page .ql-snow .ql-picker-options {
    background: #12122e;
    border-color: var(--ui-border);
    border-radius: 10px;
}

.nw-editor-page .ql-snow .ql-picker-item:hover,
.nw-editor-page .ql-snow .ql-picker-label:hover,
.nw-editor-page .ql-snow button:hover .ql-stroke,
.nw-editor-page .ql-snow button.ql-active .ql-stroke {
    stroke: #fff;
}

.nw-editor-page .ql-snow button:hover .ql-fill,
.nw-editor-page .ql-snow button.ql-active .ql-fill {
    fill: #fff;
}

.nw-editor-page .ql-snow button.ql-active,
.nw-editor-page .ql-snow .ql-picker-label.ql-active {
    color: #fff;
}

.nw-editor-page .ql-snow.ql-toolbar button:hover,
.nw-editor-page .ql-snow.ql-toolbar button.ql-active {
    background: rgba(168, 85, 247, 0.14);
    border-radius: 6px;
}

/* ============================================================
   Статистика
   ============================================================ */
.nw-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.nw-stat-card {
    position: relative;
    overflow: hidden;
    padding: 16px 16px 14px;
    border-radius: var(--ui-radius);
    border: 1px solid var(--ui-border);
    background: var(--ui-bg);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

.nw-stat-card::after {
    content: '';
    position: absolute;
    right: -24px;
    top: -24px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 70%);
    pointer-events: none;
}

.nw-stat-icon {
    font-size: 16px;
    line-height: 1;
}

.nw-stat-value {
    margin: 8px 0 2px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.nw-stat-label {
    color: var(--ui-dim);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nw-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 20px;
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    background: var(--ui-bg);
    box-shadow: var(--ui-shadow);
}

.nw-panel-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.nw-panel-sub {
    color: var(--ui-dim);
    font-size: 12px;
    font-weight: 600;
}

.nw-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

/* --- 7-дневный мини-график --- */
.nw-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nw-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 190px;
    padding-top: 22px;
}

.nw-chart-col {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: 100%;
    min-width: 0;
}

.nw-chart-bar {
    position: relative;
    width: 100%;
    max-width: 58px;
    height: calc(var(--nw-h, 0) * 1%);
    min-height: 4px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, #a855f7, #6c3ce1 60%, #4a90d9);
    box-shadow: 0 0 18px rgba(108, 60, 225, 0.3);
    transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.nw-chart-val {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nw-chart-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ui-dim);
    font-size: 11px;
    font-weight: 600;
}

.nw-chart-empty {
    padding: 30px 10px;
    text-align: center;
    color: var(--ui-dim);
    font-size: 13px;
}

/* --- Топы --- */
.nw-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nw-top-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--ui-border-soft);
}

.nw-top-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.nw-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 800;
}

.nw-rank.is-top {
    color: #ffe98a;
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.1);
}

.nw-top-main {
    min-width: 0;
}

.nw-top-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
}

.nw-top-title:hover {
    color: #cdb8ff;
}

.nw-top-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    color: var(--ui-dim);
    font-size: 11.5px;
}

.nw-top-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nw-top-values small {
    color: var(--ui-dim);
    font-size: 10.5px;
    font-weight: 600;
}

/* --- Реакции (разбивка) --- */
.nw-rx-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.nw-rx-emoji {
    width: 26px;
    flex: 0 0 auto;
    text-align: center;
    font-size: 17px;
    line-height: 1;
}

.nw-rx-bar {
    flex: 1;
    height: 8px;
    min-width: 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.nw-rx-fill {
    height: 100%;
    width: var(--nw-w, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, #6c3ce1, #a855f7);
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.nw-rx-count {
    min-width: 42px;
    color: var(--ui-muted);
    font-size: 12.5px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.nw-rx-count small {
    display: block;
    color: var(--ui-dim);
    font-size: 10px;
    font-weight: 600;
}

/* --- Авторы / черновики --- */
.nw-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--ui-border-soft);
}

.nw-author-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.nw-author-row .nw-author-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.nw-author-row .nw-author-name {
    flex: 1;
    max-width: none;
    font-size: 13px;
}

.nw-author-count {
    color: var(--ui-muted);
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.nw-draft-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ui-border-soft);
}

.nw-draft-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.nw-draft-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
}

.nw-draft-title:hover {
    color: #cdb8ff;
}

.nw-draft-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--ui-dim);
    font-size: 11.5px;
}

.nw-panel-empty {
    padding: 18px 0;
    color: var(--ui-dim);
    font-size: 13px;
    text-align: center;
}

/* ============================================================
   Главная: карточки свежих новостей
   ============================================================ */
.nw-home {
    margin-bottom: 10px;
}

.nw-home-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.nw-home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.nw-link-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b79bff;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.18s ease, transform 0.18s ease;
}

.nw-link-all:hover {
    color: #d5c4ff;
    transform: translateX(2px);
}

/* ============================================================
   Лайтбокс галереи
   ============================================================ */
.nw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 3, 12, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nw-lightbox.show {
    display: flex;
}

.nw-lightbox img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 14px;
    border: 1px solid var(--ui-border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

.nw-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.nw-lightbox-close:hover {
    border-color: var(--ui-accent-2);
    background: rgba(168, 85, 247, 0.18);
}

/* ============================================================
   Дополнения: бейджи категорий, мета статьи, статистика
   ============================================================ */
.nw-cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--ui-muted);
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.nw-cat.active .nw-cat-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.nw-article-meta .nw-author {
    gap: 9px;
}

.nw-article-meta .nw-author-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.nw-article-meta .nw-author-name {
    max-width: none;
    color: #fff;
    font-size: 13.5px;
}

.nw-article-meta .ui-chip {
    margin-left: auto;
}

.nw-top-meta .ui-chip {
    padding: 2px 8px;
    font-size: 10.5px;
    border-radius: 999px;
}

.nw-author-row .nw-author {
    flex: 1;
    min-width: 0;
}

.nw-author-count {
    flex: 0 0 auto;
    text-align: right;
    line-height: 1.35;
}

.nw-author-count small {
    color: var(--ui-dim);
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
}

.nw-empty .ui-btn {
    margin-top: 6px;
}

.nw-home-head .nw-panel-title {
    margin: 0;
}

.nw-editor-page .ui-select option {
    background: #12122e;
    color: #fff;
}

.nw-status-chip {
    align-self: flex-start;
}

.nw-panel-grid:last-of-type {
    margin-bottom: 18px;
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 900px) {
    .nw-hero {
        padding: 34px 26px;
    }

    .nw-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nw-home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nw-article-head {
        padding: 24px 22px 0;
    }

    .nw-article-body {
        padding: 20px 22px 6px;
    }

    .nw-article-foot {
        padding: 16px 22px 22px;
    }

    .nw-gallery,
    .nw-att-links {
        padding-left: 22px;
        padding-right: 22px;
    }

    .nw-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nw-editor-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .nw-publish-card {
        position: static;
    }

    .nw-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nw-panel-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .nw-filter {
        align-items: stretch;
    }

    .nw-search {
        flex: 1 1 100%;
        max-width: none;
    }

    .nw-editor-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .nw-hero {
        padding: 26px 18px;
        border-radius: 18px;
    }

    .nw-hero-title {
        letter-spacing: -0.6px;
    }

    .nw-hero-sub {
        font-size: 14px;
    }

    .nw-hero-stats {
        gap: 16px;
    }

    .nw-grid,
    .nw-home-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .nw-card-body {
        padding: 14px 16px 16px;
    }

    .nw-card-title {
        font-size: 16px;
    }

    .nw-cat {
        padding: 7px 12px;
        font-size: 12.5px;
    }

    .nw-article-cover,
    .nw-article-cover img {
        max-height: 250px;
    }

    .nw-article-head {
        padding: 20px 16px 0;
        gap: 10px;
    }

    .nw-article-title {
        font-size: 24px;
        letter-spacing: -0.3px;
    }

    .nw-article-excerpt {
        font-size: 14.5px;
    }

    .nw-article-meta {
        gap: 10px;
        padding-bottom: 14px;
        font-size: 12.5px;
    }

    .nw-article-body {
        padding: 18px 16px 4px;
    }

    .nw-rich {
        font-size: 15px;
    }

    .nw-article-foot {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 16px 20px;
    }

    .nw-reactions-label {
        display: none;
    }

    .nw-react {
        padding: 6px 10px;
        font-size: 12px;
    }

    .nw-article-share {
        justify-content: space-between;
    }

    .nw-gallery,
    .nw-att-links {
        padding-left: 16px;
        padding-right: 16px;
    }

    .nw-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nw-link {
        flex-wrap: wrap;
        gap: 6px;
    }

    .nw-link-host {
        margin-left: 0;
        max-width: 100%;
        flex-basis: 100%;
    }

    .nw-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .nw-stat-value {
        font-size: 22px;
    }

    .nw-chart-bars {
        height: 150px;
        gap: 6px;
    }

    .nw-chart-label {
        font-size: 9.5px;
    }

    .nw-chart-val {
        font-size: 10px;
    }

    .nw-panel {
        padding: 16px;
    }

    .nw-cover-preview {
        flex: 1 1 100%;
    }

    .nw-cover-actions {
        flex: 1 1 100%;
    }

    .nw-link-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .nw-link-remove {
        justify-self: end;
    }

    .nw-editor-page .ql-editor {
        min-height: 240px;
    }

    .nw-form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nw-card,
    .nw-card-cover img,
    .nw-gallery-item,
    .nw-gallery-item img,
    .nw-chart-bar,
    .nw-rx-fill,
    .nw-react,
    .nw-empty-icon {
        transition: none;
        animation: none;
    }
}
