/* ═══════════════════════════════════════════════════════════════════
   SPLIT-VIEW MODAL — Apple-level cinematic design
   LEFT: Article Content (2fr) | RIGHT: Social Panel (1fr)
   
   Design principles:
   • Depth via layered shadows, not borders
   • Typography hierarchy via weight & opacity
   • Generous consistent spacing (8px rhythm)
   • Accent color used sparingly — white/neutral dominates
   • Seamless transitions between sections
   ═══════════════════════════════════════════════════════════════════ */

/* ── DISABLED: .news-post styles moved to post-module.css ──
   The entire .modal-container.news-post experience is now in post-module.css.
   Keeping the rest of this file for non-news modal variants. */

/* ORIGINAL REMOVED — was conflicting with post-module.css:
.modal-container.news-post {
    max-width: min(640px, 96vw);
    width: 100%;
    height: 88vh;
    ...
}
*/
.modal-container.news-post-DISABLED-use-post-module {
    display: none;
}

/* Лента: одна колонка, скролл */
.news-feed {
    padding: 0;
    background: transparent;
}

.news-feed-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Картинка сверху на всю ширину, без обрезки */
.news-feed-hero {
    width: 100%;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
}

.news-feed-hero .article-hero {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
}

.news-feed-hero .article-hero img {
    max-width: 100%;
    max-height: min(50vh, 320px);
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Строка автора: аватар, имя, дата, действия */
.news-feed-head {
    padding: 0.75rem 1rem 0;
    border-bottom: none;
}

.news-feed-author-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-feed-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.news-feed-avatar--lg {
    width: 3rem;
    height: 3rem;
}

.news-feed-author-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.news-feed-author-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.news-feed-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.news-feed-head-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.news-feed-head-actions .stage-reader-mode-btn,
.news-feed-head-actions .stage-bookmark-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.8125rem;
}

/* Контент: тег, заголовок, статистика, текст */
.news-feed-content {
    padding: 0.75rem 1rem 1rem;
}

.news-feed-tag {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(168, 85, 247, 0.9);
    margin-bottom: 0.375rem;
}

.news-feed-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.98);
    margin: 0 0 0.5rem 0;
    font-family: var(--font-display, system-ui, sans-serif);
    overflow-wrap: break-word;
    word-break: break-word;
}

.news-feed-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
}

.news-feed-stats i {
    margin-right: 0.25rem;
}

.news-feed-tag-inline {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(168, 85, 247, 0.15);
    color: rgba(168, 85, 247, 0.9);
    font-size: 0.6875rem;
    font-weight: 700;
}

.news-feed-body {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 0.75rem;
}

.news-feed-body p {
    margin: 0 0 0.5rem 0;
}

.news-feed-body p:last-child {
    margin-bottom: 0;
}

.news-feed-body a {
    color: rgba(168, 85, 247, 0.9);
}

.news-feed-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    display: block;
}

.news-feed-reactions {
    padding: 0.5rem 0;
    margin: 0;
}

.news-feed-reactions .floating-reactions-bar {
    margin: 0;
    justify-content: flex-start;
}

/* Блок «Автор статьи» */
.news-feed-about-author {
    padding: 1rem;
    margin: 0 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.news-feed-about-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 0.5rem 0;
}

.news-feed-about-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.news-feed-about-row strong {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.95);
}

.news-feed-about-bio {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
}

/* Похожие материалы — сетка снизу */
.news-feed-similar {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.news-feed-similar-inner .stage-recommended-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    padding: 0 0 0.5rem 0;
}

.news-feed-similar-inner .stage-recommended-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.news-feed-similar .stage-rec-card {
    padding: 0.5rem;
    gap: 0.5rem;
}

.news-feed-similar .stage-rec-img {
    width: 3.5rem;
    min-width: 3.5rem;
    height: 2.5rem;
}

.news-feed-similar .stage-rec-title {
    font-size: 0.6875rem;
}

/* Комментарии */
.news-feed-comments {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 120px;
}

.news-feed-comments .comments-section-v2,
.news-feed-comments .cs-container {
    padding: 0;
    background: transparent;
}

.news-feed-comments .cs-header {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-feed-comments .cs-title {
    font-size: 0.8125rem;
}

.news-feed-comments .cs-sort-options {
    display: flex !important;
}

/* ========== LEFT COLUMN: Article Content ========== */
.theater-content-stage {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scroll-behavior: smooth;
    background: transparent;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* DISABLED: .news-post rules now in post-module.css */
/* .modal-container.news-post .theater-content-stage { contain: layout; } */

/* Сетка: слева — Похожие материалы, справа — статья (шире). Всё в rem — масштаб не ломает. */
.stage-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-width: 0;
    box-sizing: border-box;
}

.stage-layout--with-sidebar {
    grid-template-columns: minmax(var(--news-sidebar-min, 12rem), var(--news-sidebar-max, 16.25rem)) 1fr;
    gap: var(--news-gap);
    align-items: start;
    padding: 0 var(--news-space-m) 0;
}

.stage-recommended-column {
    position: sticky;
    top: var(--news-space-m);
    min-width: 0;
    max-width: 100%;
}

/* Колонка статьи — контент по центру, адаптивно */
.stage-article-column {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stage-article-column .stage-header,
.stage-article-column .article-hero,
.stage-article-column .stage-body,
.stage-article-column .floating-reactions-bar {
    width: 100%;
}

/* Статья в правой колонке — шире, но текст не растягиваем (удобочитаемость) */
.stage-layout--with-sidebar .stage-article-column .stage-header,
.stage-layout--with-sidebar .stage-article-column .article-hero {
    max-width: 100%;
}

.stage-layout--with-sidebar .stage-article-column .stage-body {
    max-width: min(100%, var(--news-read-width, 45rem), 70ch);
}

.stage-layout--with-sidebar .stage-article-column .floating-reactions-bar {
    max-width: 100%;
}

/* Без сайдбара — обычная ширина по центру (rem для масштаба) */
.stage-layout:not(.stage-layout--with-sidebar) .stage-article-column {
    max-width: min(var(--news-read-width, 45rem), 92%);
    margin: 0 auto;
    width: 100%;
}

/* ── Article Header — по центру, та же ширина что и блок текста ── */
.stage-header {
    padding: clamp(1rem, 2vh, 1.5rem) var(--news-space-m, 1rem) clamp(0.625rem, 1.2vh, 0.875rem) var(--news-space-m, 1rem);
    max-width: min(var(--news-read-width, 45rem), 92%);
    margin: 0 auto;
    background: transparent;
    position: relative;
    box-sizing: border-box;
}

/* Category overline — pill badge (rem = масштаб) */
.stage-overline {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(168, 85, 247, 0.85);
    margin-bottom: clamp(0.5rem, 1vh, 0.75rem);
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(168, 85, 247, 0.06);
    border: none;
    border-radius: 1.25rem;
}

/* Title row */
.stage-header-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: clamp(0.5rem, 1vh, 0.75rem);
}

.stage-title {
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
    font-weight: 800;
    line-height: 1.22;
    color: rgba(255, 255, 255, 0.97);
    margin: 0;
    letter-spacing: -0.025em;
    font-family: var(--font-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Bookmark button */
.stage-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.stage-reader-mode-btn,
.stage-bookmark-btn {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-radius: 0.625rem;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.875rem;
}

.stage-bookmark-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    color: rgba(245, 158, 11, 0.9);
    transform: scale(1.08);
}

.stage-bookmark-btn:active {
    transform: scale(0.95);
}

.stage-bookmark-btn.bookmarked,
.stage-bookmark-btn.active {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.12);
}

.stage-reader-mode-btn:hover {
    color: rgba(168, 85, 247, 0.9);
    background: rgba(168, 85, 247, 0.08);
}

.modal-container.reader-mode .stage-reader-mode-btn {
    color: rgba(168, 85, 247, 0.95);
    background: rgba(168, 85, 247, 0.15);
}

/* Meta row — масштаб не ломает */
.stage-meta {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
    padding: clamp(0.375rem, 0.8vh, 0.625rem) 0 0 0;
    border-top: none;
    opacity: 0.75;
}

.stage-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.78125rem;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

.stage-meta-item i {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.45);
}

.stage-meta-tag {
    padding: 0.1875rem 0.625rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 1.25rem;
    background: rgba(168, 85, 247, 0.1);
    border: none;
    color: rgba(168, 85, 247, 0.85);
}

/* ── Article Hero Image — только уменьшаем, не обрезаем, по центру, адаптивно ── */
.theater-content-stage .article-hero {
    width: 100%;
    max-width: min(var(--news-read-width, 45rem), 92%);
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    border-radius: 1rem;
}

/* Subtle cinematic vignette */
.theater-content-stage .article-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.15) 100%),
        linear-gradient(180deg, transparent 70%, rgba(0, 0, 0, 0.15) 100%);
    pointer-events: none;
    z-index: 1;
}

.theater-content-stage .article-hero img {
    display: block;
    max-width: 100%;
    max-height: min(40vh, 18rem);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.theater-content-stage .article-hero.is-clickable {
    cursor: zoom-in;
}

.theater-content-stage .article-hero.is-clickable:hover img {
    transform: scale(1.03);
}

/* ── Article Body — комфортная ширина чтения (rem + ch), информативно и стильно ── */
.stage-body {
    padding: clamp(1rem, 2vh, 1.5rem) var(--news-space-m, 1rem) clamp(1rem, 2vh, 1.5rem) var(--news-space-m, 1rem);
    max-width: min(var(--news-read-width, 45rem), 65ch, 92%);
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.75;
    color: rgba(232, 232, 232, 0.9);
    font-family: 'Georgia', 'Times New Roman', serif;
    letter-spacing: 0.01em;
    word-spacing: 0.02em;
    text-align: left;
    box-sizing: border-box;
}

.stage-body p {
    margin-bottom: clamp(1.125rem, 2.4vh, 1.625rem);
}

.stage-body p:last-child {
    margin-bottom: 0;
}

/* First paragraph — лид, акцент (качественно и стильно) */
.stage-body p:first-of-type {
    font-size: 1.06em;
    color: rgba(255, 255, 255, 0.94);
    border-left: 2px solid rgba(168, 85, 247, 0.45);
    padding-left: 1rem;
    margin-left: 0;
}

.stage-body h2,
.stage-body h3 {
    color: rgba(255, 255, 255, 0.96);
    font-weight: 700;
    margin-top: clamp(1.75rem, 3.5vh, 2.5rem);
    margin-bottom: 0.875rem;
    letter-spacing: -0.02em;
    font-family: var(--font-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
}

.stage-body h2 {
    font-size: 1.375rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-body h3 {
    font-size: 1.1875rem;
}

.stage-body a {
    color: rgba(168, 85, 247, 0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
    transition: all 0.25s ease;
}

.stage-body a:hover {
    color: rgba(168, 85, 247, 1);
    border-bottom-color: rgba(168, 85, 247, 0.7);
}

.stage-body blockquote {
    margin: clamp(1.25rem, 2.5vh, 1.75rem) 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.04);
    border-radius: 0 0.625rem 0.625rem 0;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
    font-size: 0.96875rem;
    line-height: 1.75;
}

.stage-body img {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.625rem;
    margin: 1rem auto;
    display: block;
}

.stage-body ul, .stage-body ol {
    margin: 1rem 0;
    padding-left: 1.25rem;
}

.stage-body li {
    margin-bottom: 0.5rem;
}

.stage-body strong {
    color: rgba(255, 255, 255, 0.97);
    font-weight: 700;
}

.stage-body em {
    color: rgba(168, 85, 247, 0.8);
    font-style: italic;
}

/* ── Scrollbar — barely visible ── */
.theater-content-stage::-webkit-scrollbar {
    width: 4px;
}

.theater-content-stage::-webkit-scrollbar-track {
    background: transparent;
}

.theater-content-stage::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.theater-content-stage::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ── Reading progress — thin, elegant ── */
.stage-progress {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    z-index: 50;
}

.stage-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.7), rgba(236, 72, 153, 0.7));
    border-radius: 0 2px 2px 0;
    transition: width 0.1s ease-out;
}

/* ── Article End — разделитель между текстом и реакциями (стильно) ── */
.stage-article-end {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.375rem var(--news-space-m, 1rem) 0.125rem;
}

.stage-article-end::before,
.stage-article-end::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.15), transparent);
}

/* ── Reactions Bar — Tiny inline row, part of the flow ── */
.floating-reactions-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.1875rem;
    padding: 0.25rem 0 0.125rem;
    margin: 0 var(--news-space-m, 1rem);
}

.floating-reactions-bar .reactions-row {
    display: flex;
    gap: 3px;
    align-items: center;
}

.floating-reactions-bar .reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    flex-direction: row;
}

.floating-reactions-bar .reaction-chip:hover {
    background: rgba(168, 85, 247, 0.08);
}

.floating-reactions-bar .reaction-chip:active {
    transform: scale(0.94);
}

.floating-reactions-bar .reaction-chip.user-reacted {
    background: rgba(168, 85, 247, 0.12);
}

.floating-reactions-bar .reaction-emoji {
    font-size: 13px;
    line-height: 1;
}

.floating-reactions-bar .reaction-count {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0;
}

.floating-reactions-bar .reaction-add-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 10px;
}

.floating-reactions-bar .reaction-add-btn:hover {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.3);
    border-style: solid;
    color: rgba(255, 255, 255, 0.6);
    transform: rotate(90deg);
}

/* Hide old vertical sidebar */
.floating-reactions-sidebar {
    display: none;
}

/* ── Recommended Posts Grid (rem = не плывёт при масштабе) ── */
.stage-recommended {
    padding: 0 var(--news-space-m, 1rem) var(--news-space-l, 1.5rem);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.25rem;
}

/* В боковой колонке — компактно, вертикальный список */
.stage-recommended-column .stage-recommended {
    padding: 0 0 var(--news-space-l, 1.5rem) 0;
    border-top: none;
    margin-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 0.875rem;
}

.stage-recommended-column .stage-recommended-title {
    padding: 0 0 0.75rem 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.65);
}

.stage-recommended-column .stage-recommended-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.stage-recommended-title {
    font-size: 0.9375rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.88);
    padding: 1.125rem 0 0.875rem;
    font-family: var(--font-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
}

.stage-recommended-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.stage-rec-card {
    display: flex;
    gap: 0.625rem;
    padding: 0.5rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.15s ease;
    overflow: hidden;
    min-width: 0;
}

.stage-rec-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stage-rec-img {
    width: 4.5rem;
    min-width: 4.5rem;
    height: 3.25rem;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

/* Превью в «Похожие материалы» — не обрезаем, только уменьшаем и центруем */
.stage-rec-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.stage-rec-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.stage-rec-tag {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    color: white;
    width: fit-content;
}

.stage-rec-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════
   RIGHT COLUMN — Unified Social Panel
   Seamless flow: Author → Comments. No harsh separators.
   ═══════════════════════════════════════════════════════════════════ */
.theater-social-panel {
    display: flex;
    flex-direction: column;
    background: rgba(14, 14, 20, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease,
                min-width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Comments Toggle Button — on the right edge of the article (divider) ── */
.comments-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 100;
    width: 28px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.25s ease,
                color 0.25s ease,
                box-shadow 0.25s ease,
                transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
    font-size: 13px;
    backdrop-filter: blur(20px);
}

.comments-toggle-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: -4px 0 20px rgba(168, 85, 247, 0.15);
}

.comments-toggle-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.comments-toggle-btn i {
    transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Collapsed: panel hidden, button chevron points left to expand */
.modal-container.comments-collapsed .comments-toggle-btn i {
    transform: rotate(180deg);
}

/* ── Collapsed state for modal grid ── */
.modal-container.comments-collapsed {
    grid-template-columns: 1fr 0fr;
}

.modal-container.comments-collapsed .theater-social-panel {
    width: 0;
    min-width: 0;
    opacity: 0;
    overflow: hidden;
    border-left: none;
    pointer-events: none;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease,
                min-width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Режим читалки: полный экран, один столбец, удобное чтение ── */
.modal-container.reader-mode {
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-container.reader-mode .theater-social-panel {
    display: none;
}

.modal-container.reader-mode .theater-content-stage {
    max-width: 100%;
    width: 100%;
    padding-left: clamp(24px, 4vw, 48px);
    padding-right: clamp(24px, 4vw, 48px);
}

.modal-container.reader-mode .stage-header,
.modal-container.reader-mode .stage-body {
    max-width: min(var(--news-read-width, 45rem), 65ch);
    margin-left: auto;
    margin-right: auto;
}

.modal-container.reader-mode .theater-content-stage .article-hero {
    max-width: min(var(--news-read-width, 45rem), 88%);
}

.modal-container.reader-mode .floating-reactions-bar {
    max-width: min(var(--news-read-width, 45rem), 65ch);
    margin-left: auto;
    margin-right: auto;
}

.modal-container.reader-mode .comments-toggle-btn {
    display: none;
}

/* DISABLED: reader-mode for news-post now in post-module.css (cinema-mode) */
.modal-container.reader-mode .news-feed-content {
    max-width: min(65ch, 100%);
    margin: 0 auto;
}


/* ── Author Card — Label + avatar + bio ── */
.author-profile-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 16px 14px;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.author-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(168, 85, 247, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.author-label i {
    font-size: 10px;
    color: rgba(168, 85, 247, 0.6);
}

.author-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-profile-card .author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.author-profile-card .author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-profile-card .author-info {
    flex: 1;
    min-width: 0;
}

.author-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.author-profile-card .author-name {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.author-level-badge {
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.1);
    color: rgba(168, 85, 247, 0.8);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.author-profile-card .author-rank {
    font-size: 11px;
    font-weight: 500;
    color: rgba(245, 158, 11, 0.65);
    display: flex;
    align-items: center;
    gap: 4px;
}

.author-profile-card .author-rank i {
    font-size: 9px;
}

/* Author bio */
.author-bio {
    font-size: 11.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.32);
    padding: 0 2px;
}

/* ── Comments Area — Scrollable, seamless ── */
.social-panel-comments {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(14px, 1.8vh, 20px) 16px clamp(20px, 2.5vh, 28px) 16px;
    min-height: 0;
}

/* Scrollbar */
.social-panel-comments::-webkit-scrollbar {
    width: 3px;
}

.social-panel-comments::-webkit-scrollbar-track {
    background: transparent;
}

.social-panel-comments::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.social-panel-comments::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ── Comment System Overrides (v3) ── */
.social-panel-comments .comment-system-wrapper,
.social-panel-comments .comments-section-v2 {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.social-panel-comments .cs-container {
    background: transparent;
    padding: 0;
    margin-top: 0;
    border-radius: 0;
}

/* Comments header — заголовок + сортировка всегда видны */
.social-panel-comments .cs-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 0 14px 0;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.social-panel-comments .cs-title {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.social-panel-comments .cs-title i {
    font-size: 13px;
    color: rgba(168, 85, 247, 0.5);
}

/* Сортировка — вторая строка, всегда видна (Новое / Популярное) */
.social-panel-comments .cs-sort-options {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0;
    gap: 0;
    min-height: 34px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 3px;
    width: fit-content;
}

.social-panel-comments .cs-sort-btn {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-panel-comments .cs-sort-btn:hover {
    color: rgba(255, 255, 255, 0.85);
}

.social-panel-comments .cs-sort-btn.active {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(168, 85, 247, 0.2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Login prompt — Apple-like call to action */
.social-panel-comments .cs-login-prompt {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.social-panel-comments .cs-login-prompt i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.25);
}

.social-panel-comments .cs-login-btn {
    margin-left: auto;
    padding: 6px 16px;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(168, 85, 247, 0.15);
    border: none;
    color: rgba(168, 85, 247, 0.95);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.social-panel-comments .cs-login-btn:hover {
    background: rgba(168, 85, 247, 0.25);
    color: white;
    box-shadow: 0 2px 12px rgba(168, 85, 247, 0.15);
}

/* ── Comment form ── */
.social-panel-comments .cs-form-wrapper {
    margin-bottom: 14px;
}

.social-panel-comments .cs-form-input-wrap {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.social-panel-comments .cs-form-input-wrap:focus-within {
    border-color: rgba(168, 85, 247, 0.25);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.05);
    background: rgba(255, 255, 255, 0.03);
}

/* ── Individual Comment — compact, content-first ── */
.social-panel-comments .cs-comment {
    padding: 8px 4px;
    border-radius: 8px;
    transition: background 0.12s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}

.social-panel-comments .cs-comment:last-child {
    border-bottom: none;
}

.social-panel-comments .cs-comment:hover {
    background: rgba(255, 255, 255, 0.015);
}

/* Smaller round avatars in sidebar */
.social-panel-comments .cs-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Tighter body padding */
.social-panel-comments .cs-body {
    padding-left: 8px;
}

.social-panel-comments .cs-author {
    font-size: 12px;
    font-weight: 700;
}

.social-panel-comments .cs-meta {
    gap: 5px;
    margin-bottom: 3px;
}

.social-panel-comments .cs-user-level {
    font-size: 7px;
    padding: 1px 4px;
}

.social-panel-comments .cs-score {
    font-size: 9px;
    padding: 1px 5px;
}

.social-panel-comments .cs-date {
    font-size: 9px;
}

/* Comment text — maximum space */
.social-panel-comments .cs-content {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
}

/* Tiny vote buttons in sidebar */
.social-panel-comments .cs-vote {
    padding: 3px 6px;
    min-width: 26px;
    border-radius: 14px;
    font-size: 10px;
}

.social-panel-comments .cs-vote i {
    font-size: 10px;
}

.social-panel-comments .cs-vote.has-count {
    padding: 3px 8px;
    min-width: 34px;
    gap: 3px;
}

.social-panel-comments .cs-vote span {
    font-size: 10px;
}

/* Smaller action buttons */
.social-panel-comments .cs-actions {
    gap: 2px;
    margin-bottom: 3px;
}

.social-panel-comments .cs-btn {
    font-size: 10px;
    padding: 2px 6px;
}

/* Replies indentation — less aggressive */
.social-panel-comments .cs-replies > .cs-comment {
    margin-left: 16px;
}

.social-panel-comments .cs-replies .cs-replies > .cs-comment,
.social-panel-comments .cs-replies .cs-replies .cs-replies > .cs-comment {
    margin-left: 0;
}

.social-panel-comments .cs-container {
    min-width: 0;
    overflow-x: hidden;
}

.social-panel-comments .cs-thread-toggle {
    font-size: 12px;
    padding: 2px 0;
}

/* Empty state */
.social-panel-comments .cs-empty {
    padding: 36px 14px;
    color: rgba(255, 255, 255, 0.18);
    font-size: 12px;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════════════
   MOBILE: Stack Layout (≤1024px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    /* DISABLED: .news-post rules now in post-module.css */
    /* .modal-container.news-post { width: 96%; max-width: 96%; height: 90vh; max-height: 90vh; } */
    
    .theater-content-stage {
        max-height: 50vh;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    /* DISABLED: .news-post rules now in post-module.css */
    /* .modal-container.news-post .theater-content-stage { max-height: none; } */
    
    .news-feed-hero .article-hero img {
        max-height: min(40vh, 240px);
    }
    
    .news-feed-similar .stage-recommended-grid {
        grid-template-columns: 1fr;
    }
    
    .stage-header {
        padding: 1.25rem 1rem 0.875rem;
        max-width: min(var(--news-read-width, 45rem), 94%);
    }
    
    .stage-header-row {
        gap: 10px;
    }
    
    .stage-title {
        font-size: clamp(20px, 5vw, 28px);
    }
    
    .stage-bookmark-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    
    .stage-meta {
        gap: 10px;
    }
    
    .stage-body {
        padding: 1rem;
        max-width: min(var(--news-read-width, 45rem), 94%);
        font-size: 1.0625rem;
    }
    
    .theater-content-stage .article-hero {
        max-width: min(20rem, 94%);
        padding: 0;
        border-radius: 0.875rem;
    }
    
    .theater-content-stage .article-hero img {
        max-height: min(55vh, 25rem);
        object-fit: contain;
    }
    
    /* Reactions bar — tighter on mobile */
    .floating-reactions-bar {
        margin: 0 16px;
    }
    
    .stage-recommended {
        padding: 0 16px 24px;
    }
    
    .stage-recommended-grid {
        grid-template-columns: 1fr;
    }
    
    /* На мобильных — одна колонка: сначала статья, потом Похожие материалы */
    .stage-layout--with-sidebar {
        grid-template-columns: 1fr;
        padding: 0 16px 0;
    }
    
    .stage-layout--with-sidebar .stage-article-column {
        order: 1;
    }
    
    .stage-layout--with-sidebar .stage-recommended-column {
        order: 2;
        position: static;
    }
    
    .stage-layout--with-sidebar .stage-recommended-column .stage-recommended {
        border-left: none;
        padding-left: 0;
        padding-top: 16px;
        margin-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    /* Author card — mobile */
    .author-profile-card {
        padding: 12px 14px;
        gap: 8px;
    }
    
    .author-row {
        gap: 8px;
    }
    
    .author-profile-card .author-avatar {
        width: 36px;
        height: 36px;
    }
    
    .author-profile-card .author-name {
        font-size: 12px;
    }
    
    .author-profile-card .author-rank {
        font-size: 10px;
    }
    
    .author-bio {
        font-size: 11px;
    }
    
    .social-panel-comments {
        padding: 12px 14px 18px 14px;
    }
    
    .theater-social-panel {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .stage-progress {
        display: none;
    }
    
    /* Hide toggle on mobile — no room */
    .comments-toggle-btn {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   SCALED UI — 125% OS zoom
   ═══════════════════════════════════════════════════════════════════ */
.scaled-ui .stage-header {
    padding: clamp(14px, 1.8vh, 20px) 14px clamp(8px, 1vh, 12px) 14px;
    max-width: min(720px, 90%);
}

.scaled-ui .stage-title {
    font-size: clamp(20px, 2.4vw, 30px);
}

.scaled-ui .stage-body {
    padding: clamp(14px, 1.8vh, 20px) 14px clamp(14px, 1.8vh, 20px) 14px;
    font-size: 17px;
}

.scaled-ui .theater-content-stage .article-hero {
    max-width: min(320px, 82%);
    padding: 0;
}

.scaled-ui .floating-reactions-bar {
    margin: 0 14px;
}

.scaled-ui .stage-recommended {
    padding: 0 14px 20px;
}

.scaled-ui .author-profile-card {
    padding: 12px 14px 10px;
    gap: 8px;
}

.scaled-ui .author-profile-card .author-avatar {
    width: 36px;
    height: 36px;
}

.scaled-ui .social-panel-comments {
    padding: 12px 14px 20px 14px;
}
