.news-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
    padding: 0 1.25rem 1.5rem;
    box-sizing: border-box;
}

.news-page--gate {
    padding-top: 0.5rem;
}

.news-page--gate .news-gate-card {
    margin: 0 auto;
}

.news-page--editor {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-anchor: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.news-page--editor::-webkit-scrollbar {
    width: 6px;
}

.news-page--editor::-webkit-scrollbar-track {
    background: transparent;
}

.news-page--editor::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.news-page--editor:not(:hover)::-webkit-scrollbar-thumb {
    background: transparent;
}

.right-menu-content.is-visible > .news-page {
    flex: 1;
    min-height: 0;
}

[data-news-gate][hidden],
[data-news-editor][hidden] {
    display: none !important;
}

[data-news-editor]:not([hidden]) {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* --- Gate card (client) --- */
.news-gate-card {
    max-width: 560px;
    margin: 0.5rem 0;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.news-gate-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-gate-card__badge {
    align-self: flex-start;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--office-accent, #38bdf8);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}

.news-gate-card__title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--office-text, #f8fafc);
}

.news-gate-card__lead {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--office-text-muted, #94a3b8);
    max-width: 48ch;
}

.news-gate-card__lead a {
    color: var(--office-accent, #38bdf8);
    text-decoration: none;
}

.news-gate-card__lead a:hover {
    text-decoration: underline;
}

.news-gate-card__steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.news-gate-card__step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--office-text, #e2e8f0);
}

.news-gate-card__step-num {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--office-accent, #38bdf8);
    background: rgba(56, 189, 248, 0.15);
}

.news-gate-card__highlight {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--office-text, #e2e8f0);
    background: rgba(56, 189, 248, 0.08);
    border-left: 3px solid var(--office-accent, #38bdf8);
}

.news-gate-card__actions {
    margin-top: 0.25rem;
}

.news-header {
    flex-shrink: 0;
    margin: 0 -1.25rem 1rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--office-border, #2a3344);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: var(--office-bg, #0f1724);
}

.news-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 3rem;
}

.news-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    align-items: stretch;
}

.news-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--office-text-muted, #94a3b8);
    border-radius: 0;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font: inherit;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.news-tab:hover {
    color: var(--office-text, #f8fafc);
}

.news-tab.is-active {
    color: var(--office-text, #f8fafc);
    border-bottom-color: var(--office-accent, #38bdf8);
    background: transparent;
}

.news-body {
    padding: 0.25rem 0 1rem;
}

.news-panel[hidden] {
    display: none !important;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.news-card {
    border: 1px solid var(--office-border, #2a3344);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 36, 0.6);
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.news-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.news-card__cover {
    aspect-ratio: 16 / 9;
    background: #111827;
    object-fit: cover;
    width: 100%;
}

.news-card__cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--office-text-muted, #64748b);
    font-size: 0.875rem;
}

.news-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.news-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.news-card__date {
    margin: 0;
    color: var(--office-text-muted, #94a3b8);
    font-size: 0.8125rem;
}

.news-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--office-text-muted, #94a3b8);
}

.news-card__link {
    margin-top: auto;
    color: var(--office-accent, #38bdf8);
    text-decoration: none;
    font-size: 0.875rem;
}

.news-card__link:hover {
    text-decoration: underline;
}

.news-empty {
    color: var(--office-text-muted, #94a3b8);
    margin: 0;
    padding: 1rem 0;
}

/* --- Create tab: form + preview --- */
.news-create__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .news-create__grid {
        grid-template-columns: 1fr;
    }

    .news-create__preview {
        order: 2;
    }
}

.news-create__preview {
    position: sticky;
    top: 1rem;
}

.news-create__preview-label {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--office-text-muted, #94a3b8);
}

.news-preview-frame {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.news-preview-frame::-webkit-scrollbar {
    width: 5px;
}

.news-preview-frame::-webkit-scrollbar-track {
    background: transparent;
}

.news-preview-frame::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 3px;
}

.news-preview-frame:not(:hover)::-webkit-scrollbar-thumb {
    background: transparent;
}

.news-preview-card {
    color: #2d3748;
}

.news-preview-card__header {
    margin-bottom: 1rem;
}

.news-preview-frame .news-title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    line-height: 1.3;
    font-weight: 700;
    color: #1a202c;
}

.news-preview-frame .news-date {
    display: block;
    font-size: 0.8125rem;
    color: #718096;
}

.news-preview-category {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #4299e1;
    text-transform: lowercase;
}

.news-preview-placeholder {
    margin: 0;
    color: #a0aec0;
    font-style: italic;
}

.news-preview-reactions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.news-preview-reactions__label {
    font-size: 0.75rem;
    color: #a0aec0;
}

/* Preview media grid (scoped from public new.css) */
.news-preview-frame .news-media-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 1rem;
    height: 200px;
}

.news-preview-frame .news-media-preview[data-count="1"] {
    grid-template-columns: 1fr;
    height: 180px;
}

.news-preview-frame .media-preview-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #edf2f7;
}

.news-preview-frame .media-preview-item img,
.news-preview-frame .media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-preview-frame .media-preview-item.is-primary {
    grid-row: span 2;
}

.news-preview-frame .media-primary-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 999px;
}

/* Preview content typography */
.news-preview-frame .news-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #2d3748;
}

.news-preview-frame .news-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #e2e8f0;
}

.news-preview-frame .news-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0.75rem 0 0.35rem;
}

.news-preview-frame .news-content ul,
.news-preview-frame .news-content ol {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.news-preview-frame .news-content blockquote {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    background: #edf2f7;
    border-left: 3px solid #38b2ac;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4a5568;
}

.news-preview-frame .news-content blockquote cite {
    display: block;
    font-size: 0.8125rem;
    font-style: normal;
    color: #718096;
    margin-top: 0.5rem;
    text-align: right;
}

.news-preview-frame .news-content blockquote cite::before {
    content: "— ";
}

.news-preview-frame .news-content .tip {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    font-size: 0.875rem;
    font-style: normal;
    color: #78350f;
}

.news-preview-frame .news-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.8125rem;
    color: #1a202c;
}

.news-preview-frame .news-content th,
.news-preview-frame .news-content td {
    border: 1px solid #4a5568;
    padding: 0.4rem 0.55rem;
    text-align: left;
    color: #1a202c;
    background: #fff;
}

.news-preview-frame .news-content th {
    background: #edf2f7;
    font-weight: 600;
    color: #1a202c;
}

.news-preview-frame .news-content tr:nth-child(even) td {
    background: #f7fafc;
    color: #1a202c;
}

.news-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: none;
}

.news-form__label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
}

.news-form__hint {
    margin: 0;
    color: var(--office-text-muted, #94a3b8);
    font-size: 0.8125rem;
}

.news-input {
    border: 1px solid var(--office-border, #2a3344);
    border-radius: 8px;
    background: rgba(15, 23, 36, 0.8);
    color: var(--office-text, #f8fafc);
    padding: 0.6rem 0.75rem;
    font: inherit;
}

.news-input:focus {
    outline: 2px solid rgba(56, 189, 248, 0.35);
    border-color: var(--office-accent, #38bdf8);
}

.news-media__previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.news-media__item {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--office-border, #2a3344);
}

.news-media__item img,
.news-media__item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-media__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.news-media__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1rem;
    border: 1px dashed var(--office-border, #475569);
    border-radius: 8px;
    cursor: pointer;
    color: var(--office-text-muted, #94a3b8);
    font-size: 0.875rem;
}

.news-form .market-editor,
.news-editor {
    border: 1px solid var(--office-border, #2a3344);
    border-radius: 8px;
    overflow: visible;
}

.news-editor__toolbar {
    position: sticky;
    top: 0;
    z-index: 4;
    flex-wrap: wrap;
    gap: 2px;
    background: var(--office-surface, #151d2e);
    border-bottom: 1px solid var(--office-border, #2a3344);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.news-editor__toolbar .market-editor__btn.is-disabled,
.news-editor__toolbar .market-editor__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.news-editor .market-editor__surface {
    min-height: 200px;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-anchor: none;
    border-radius: 0 0 8px 8px;
}

.news-editor .market-editor__surface.is-empty {
    position: relative;
}

.news-editor .market-editor__surface.is-empty::before {
    position: absolute;
    top: 0.65rem;
    left: 0.75rem;
    right: 0.75rem;
    content: attr(data-placeholder);
    pointer-events: none;
    color: var(--office-text-muted, #64748b);
}

.news-editor__toolbar .market-editor__btn[data-cmd="exitBlock"] {
    font-size: 0.75rem;
}

.news-editor .market-editor__surface table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    border: 1px solid rgba(148, 163, 184, 0.55);
}

.news-editor .market-editor__surface th,
.news-editor .market-editor__surface td {
    border: 1px solid rgba(148, 163, 184, 0.65);
    padding: 0.35rem 0.5rem;
    min-width: 48px;
    vertical-align: top;
    color: var(--office-text, #f8fafc);
}

.news-editor .market-editor__surface th {
    background: rgba(56, 189, 248, 0.15);
    font-weight: 600;
}

.news-editor .market-editor__surface tr:nth-child(even) td {
    background: rgba(148, 163, 184, 0.08);
}

.news-editor .market-editor__surface .tip {
    margin: 0.5rem 0;
    padding: 0.65rem 0.85rem;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-left: 4px solid #eab308;
    border-radius: 8px;
    font-style: normal;
    color: var(--office-text, #f8fafc);
}

.news-editor .market-editor__surface blockquote {
    margin: 0.5rem 0;
    padding: 0.65rem 0.85rem;
    border-left: 3px solid #38b2ac;
    color: var(--office-text-muted, #cbd5e1);
    font-style: italic;
}

.news-editor .market-editor__surface blockquote cite {
    display: block;
    font-size: 0.8125rem;
    font-style: normal;
    margin-top: 0.35rem;
    text-align: right;
    color: var(--office-text-muted, #94a3b8);
}

.news-editor .market-editor__surface a {
    color: var(--office-accent, #38bdf8);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.news-editor .market-editor__surface a:hover {
    color: #7dd3fc;
}

.news-preview-frame .news-content a {
    color: #3182ce;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.news-preview-frame .news-content a:hover {
    color: #2c5282;
}

.news-btn {
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.25rem;
    font: inherit;
    cursor: pointer;
}

.news-btn--primary {
    background: var(--office-accent, #38bdf8);
    color: #0f172a;
    font-weight: 600;
}

.news-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.news-form__status {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}

.news-form__status.is-error {
    color: #f87171;
}

.news-form__status.is-success {
    color: #4ade80;
}
