:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-muted: #f7f8fa;
    --text: #17191c;
    --text-muted: #656b73;
    --border: #e5e7eb;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --focus: #93c5fd;
    --radius: 8px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --reader: "Inter", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --ui: "Inter", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --image-lead-height: clamp(220px, 22vw, 360px);
    --image-card-height: clamp(128px, 11vw, 184px);
    --image-brief-width: 128px;
    --image-brief-height: 72px;
    --ink-0: #050607;
    --ink-1: #090c0f;
    --ink-2: #0f1419;
    --ink-3: #171d24;
    --ink-line: rgba(255, 255, 255, 0.095);
    --ink-muted: rgba(238, 241, 244, 0.64);
    --ink-soft: rgba(238, 241, 244, 0.78);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111317;
        --surface: #111317;
        --surface-muted: #191c21;
        --text: #f4f5f6;
        --text-muted: #9ca3af;
        --border: #30343b;
        --accent: #60a5fa;
        --accent-strong: #93c5fd;
        --focus: #2563eb;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: #737b86 #0f151b;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--ink-0);
}

::-webkit-scrollbar-thumb {
    border: 3px solid var(--ink-0);
    border-radius: 999px;
    background: #5f6872;
}

::-webkit-scrollbar-thumb:hover {
    background: #9aa3ad;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--ui);
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

button,
input,
textarea,
select {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(210px, 260px) minmax(0, 720px) minmax(280px, 360px);
    justify-content: center;
    min-height: 100vh;
}

.editor-page-shell {
    display: grid;
    grid-template-columns: minmax(0, 840px) minmax(272px, 360px);
    justify-content: center;
    width: 100%;
    min-height: calc(100vh - 68px);
    border-top: 1px solid var(--ink-line);
}

.editor-page-shell .content-column {
    background: rgba(9, 14, 19, 0.72);
}

.editor-page-shell .feed-header {
    top: 68px;
    background: rgba(8, 12, 16, 0.82);
}

.editor-page-shell .context-column {
    top: 68px;
    height: calc(100vh - 68px);
    border-left: 1px solid var(--border);
    padding: var(--space-6);
}

.editor-page-shell .context-panel {
    background: rgba(16, 22, 29, 0.78);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100vh;
    border-right: 1px solid var(--border);
    padding: 18px 22px 24px 12px;
}

.brand,
.main-nav a,
.nav-disabled {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
    width: fit-content;
    padding: 8px 10px;
    border-radius: 999px;
    font-weight: 800;
}

.brand-mark,
.avatar {
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-weight: 900;
}

.brand-mark {
    width: 34px;
    height: 34px;
}

.brand-word {
    font-size: 1.08rem;
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.main-nav a,
.nav-disabled {
    gap: 14px;
    width: fit-content;
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 1.05rem;
}

.main-nav a:hover,
.brand:hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.main-nav .active {
    font-weight: 800;
}

.nav-disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.primary-action,
.feed-header a,
.empty-state a,
.panel-link,
.form-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    padding: 0 18px;
}

.primary-action:hover,
.feed-header a:hover,
.empty-state a:hover,
.panel-link:hover,
.form-actions button:hover {
    background: var(--accent-strong);
    text-decoration: none;
}

.account-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    color: var(--text);
}

.account-summary span {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.avatar {
    width: 40px;
    height: 40px;
}

.content-column,
.reader-column {
    min-width: 0;
    border-right: 1px solid var(--border);
}

.feed-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    padding: 12px 18px;
}

.feed-header h1 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.15;
}

.feed-header p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.feed-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 48px;
    border-bottom: 1px solid var(--border);
}

.feed-tabs a,
.feed-tabs span {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-weight: 700;
}

.feed-tabs .selected {
    position: relative;
    color: var(--text);
}

.feed-tabs .selected::after {
    position: absolute;
    bottom: 0;
    width: 64px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    content: "";
}

.editor-note,
.news-card,
.empty-state,
.article-module {
    border-bottom: 1px solid var(--border);
    padding: 16px 18px;
}

.editor-note {
    background: var(--surface-muted);
}

.editor-note p,
.summary,
.empty-state p,
.context-panel p,
.article-summary,
.article-module p {
    color: var(--text-muted);
    margin: 4px 0 0;
}

.source-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.publisher {
    color: var(--text);
    font-weight: 800;
}

.headline-link:hover {
    text-decoration: none;
}

.news-card h2 {
    margin: 8px 0 6px;
    font-size: 1.25rem;
    line-height: 1.25;
}

.story-visual,
.article-hero {
    display: grid;
    align-content: end;
    min-height: 170px;
    margin: 14px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), transparent 42%),
        var(--surface-muted);
    padding: 18px;
}

.story-visual:hover {
    text-decoration: none;
}

.story-visual span,
.article-hero span,
.kicker {
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.story-visual strong,
.article-hero strong {
    max-width: 460px;
    font-family: var(--reader);
    font-size: 1.75rem;
    line-height: 1.08;
}

.article-cover {
    margin: 18px 0 0;
}

.article-cover img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 480px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    object-fit: cover;
}

.article-cover figcaption {
    display: grid;
    gap: 3px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.article-cover small {
    color: var(--text-muted);
}

.transparency-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 14px 0 0;
}

.transparency-row div,
.compact-facts div {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    padding: 10px;
}

dt {
    color: var(--text-muted);
    font-size: 0.78rem;
}

dd {
    margin: 2px 0 0;
    font-weight: 700;
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.card-actions a,
.card-actions button {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    padding: 7px 12px;
}

.card-actions button:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.empty-state {
    padding: 34px 18px;
}

.empty-state h2 {
    margin: 0;
}

.context-column {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100vh;
    padding: 12px 0 24px 24px;
}

.search-box label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.search-box input {
    width: min(336px, 100%);
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    padding: 0 16px;
}

.context-panel {
    width: min(336px, 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 16px;
}

.context-panel h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.context-panel ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
}

.panel-link {
    margin-top: 12px;
}

.reader-column {
    max-width: 760px;
}

.article-header {
    padding: 22px 24px 10px;
}

.back-link {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.article-header h1 {
    max-width: 680px;
    margin: 8px 0 12px;
    font-family: var(--reader);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    line-height: 1.06;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 14px;
}

.article-body {
    max-width: 680px;
    padding: 10px 24px 28px;
    font-family: var(--reader);
    font-size: 1.12rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.article-module h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.perspective-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.perspective-grid article,
.source-list li {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    padding: 12px;
}

.perspective-grid h3 {
    margin: 0 0 6px;
}

.source-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.source-list span {
    display: block;
    color: var(--text-muted);
}

.compact-facts {
    display: grid;
    gap: 10px;
    margin: 0;
}

.article-form {
    display: grid;
    gap: 18px;
    padding: 20px 18px 40px;
}

.article-form label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.article-form input,
.article-form textarea,
.article-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    padding: 12px 13px;
}

.image-fieldset {
    display: grid;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.image-fieldset legend {
    padding: 0 6px;
    font-weight: 850;
}

.article-form .checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 700;
}

.article-form .checkbox-row input {
    width: auto;
}

.field-error {
    color: #dc2626;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.form-actions a {
    color: var(--text-muted);
}

.mobile-nav {
    display: none;
}

.success-message,
.preview-banner {
    border-bottom: 1px solid var(--border);
    margin: 0;
    padding: 14px 18px;
}

.success-message {
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--text);
    font-weight: 700;
}

.import-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    padding: 18px;
}

.json-editor {
    display: grid;
    gap: 8px;
}

.json-editor label,
.import-panel h2 {
    font-weight: 800;
}

.json-editor textarea {
    min-height: 520px;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    color: var(--text);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 14px;
}

.import-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.import-panel h2,
.import-panel h3 {
    margin: 0;
}

.import-panel p {
    color: var(--text-muted);
    margin: 0;
}

.import-actions {
    display: grid;
    gap: 10px;
}

.file-upload {
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    padding: 12px;
    font-weight: 800;
}

.file-upload input {
    width: 100%;
    color: var(--text-muted);
    font-weight: 400;
}

.file-upload span {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 400;
}

.import-actions button {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
}

.import-actions button:hover {
    border-color: var(--accent);
}

.validation-box,
.preview-grid section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    padding: 12px;
}

.validation-box.valid {
    border-color: var(--accent);
}

.validation-box.invalid {
    border-color: #dc2626;
}

.validation-box ul,
.preview-grid ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.preview-banner {
    background: #7f1d1d;
    color: #ffffff;
}

.preview-banner p {
    margin: 4px 0 0;
}

.import-preview {
    border-bottom: 1px solid var(--border);
    padding: 20px 18px;
}

.import-preview h2 {
    margin: 0 0 8px;
    font-family: var(--reader);
    font-size: 2rem;
    line-height: 1.1;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.preview-grid h3 {
    margin: 0 0 8px;
}

.preview-grid span {
    display: block;
    color: var(--text-muted);
}

.history-table {
    display: grid;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.history-row {
    display: grid;
    grid-template-columns: 1.5fr 0.7fr 0.8fr 1fr;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding: 10px;
}

.history-row:first-child {
    border-top: 0;
}

.history-head {
    background: var(--surface-muted);
    color: var(--text-muted);
    font-weight: 800;
}

@media (max-width: 1080px) {
    .editor-page-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .editor-page-shell .context-column {
        display: none;
    }

    .app-shell {
        grid-template-columns: 76px minmax(0, 720px);
    }

    .sidebar {
        align-items: center;
        padding-right: 10px;
    }

    .brand-word,
    .main-nav a,
    .nav-disabled,
    .primary-action,
    .account-summary,
    .context-column {
        display: none;
    }
}

@media (max-width: 720px) {
    .editor-page-shell {
        display: block;
    }

    .editor-page-shell .feed-header {
        top: 0;
    }

    .app-shell {
        display: block;
        padding-bottom: 62px;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 10px 14px;
    }

    .brand-word {
        display: inline;
    }

    .content-column,
    .reader-column {
        border-right: 0;
    }

    .feed-header {
        min-height: 64px;
    }

    .feed-header a {
        display: none;
    }

    .transparency-row {
        grid-template-columns: 1fr;
    }

    .import-layout,
    .preview-grid,
    .history-row {
        grid-template-columns: 1fr;
    }

    .story-visual,
    .article-hero {
        min-height: 128px;
    }

    .article-header {
        padding: 18px 16px 8px;
    }

    .article-body {
        padding-inline: 16px;
    }

    .mobile-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        border-top: 1px solid var(--border);
        background: var(--bg);
    }

    .mobile-nav a {
        display: grid;
        min-height: 54px;
        place-items: center;
        color: var(--text-muted);
        font-weight: 700;
    }

    .mobile-nav .active {
        color: var(--text);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Premium public article page */
.article-page {
    min-height: 100vh;
    background: var(--ink-0);
    color: #f2f3f5;
}

.article-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-6);
    min-height: 68px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(5, 6, 7, 0.78);
    backdrop-filter: blur(18px) saturate(1.18);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035), 0 16px 32px rgba(0, 0, 0, 0.22);
    padding: 0 var(--space-8);
}

.article-logo {
    color: #f6f7f8;
    font-size: 2rem;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.article-logo:hover,
.article-nav a:hover,
.article-back:hover {
    text-decoration: none;
}

.article-nav {
    display: flex;
    gap: var(--space-6);
    justify-content: center;
    color: #d8dde2;
}

.article-nav a,
.article-back {
    color: #d8dde2;
    font-size: 0.95rem;
}

.article-back {
    border: 1px solid var(--ink-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    padding: 8px 14px;
}

.article-premium {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(272px, 336px);
    gap: var(--space-8);
    width: 100%;
    min-height: calc(100vh - 68px);
    border-right: 1px solid var(--ink-line);
    background: var(--ink-1);
}

.article-premium-main {
    min-width: 0;
    padding: var(--space-8) clamp(var(--space-6), 5vw, 80px) 64px;
}

.article-premium-header {
    width: min(100%, 1120px);
    margin-inline: auto;
}

.article-premium-header .back-link {
    display: inline-flex;
    margin-bottom: var(--space-6);
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.article-premium-meta {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    color: var(--ink-muted);
    font-size: 0.84rem;
}

.article-premium-meta span {
    color: #d7dce1;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-premium-header h1 {
    max-width: 1080px;
    margin: var(--space-3) 0 var(--space-4);
    font-family: var(--ui);
    font-size: clamp(2.75rem, 6vw, 5.5rem);
    font-weight: 880;
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.article-premium-header .article-summary {
    max-width: 760px;
    color: var(--ink-soft);
    font-size: clamp(1rem, 1.35vw, 1.18rem);
    line-height: 1.45;
}

.article-byline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.premium-cover {
    width: min(100%, 1200px);
    margin-top: var(--space-8);
    margin-inline: auto;
}

.premium-cover img {
    max-height: none;
    border-color: var(--ink-line);
    filter: brightness(0.72) contrast(1.08) saturate(0.88);
}

.premium-cover figcaption {
    color: var(--ink-muted);
}

.premium-body {
    max-width: 720px;
    margin-inline: auto;
    padding: var(--space-8) 0 0;
    color: #eff2f4;
    font-family: var(--ui);
    font-size: 1.08rem;
    line-height: 1.68;
}

.premium-module {
    max-width: 720px;
    margin-inline: auto;
    border-top: 1px solid var(--ink-line);
    border-bottom: 0;
    margin-top: var(--space-8);
    padding: var(--space-6) 0 0;
}

.premium-module h2 {
    margin: 0 0 var(--space-4);
    color: #f2f3f5;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.premium-module .source-list {
    display: grid;
    gap: var(--space-3);
    list-style: none;
    margin: 0;
    padding: 0;
}

.premium-module .source-list li {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius);
    background: var(--ink-2);
    padding: var(--space-4);
}

.premium-module .source-list a {
    color: #f2f3f5;
    font-weight: 800;
}

.premium-module .source-list span {
    color: var(--ink-muted);
}

.related-posts {
    width: min(100%, 1200px);
    margin-inline: auto;
    border-top: 1px solid var(--ink-line);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
}

.related-posts-head {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.related-posts-head span,
.related-post-meta span {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.related-posts-head h2 {
    max-width: 560px;
    margin: 0;
    color: #f4f6f8;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--ink-line);
    border-left: 1px solid var(--ink-line);
}

.related-post-card {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-right: 1px solid var(--ink-line);
    border-bottom: 1px solid var(--ink-line);
    padding: var(--space-4);
    transition: background-color 160ms ease, border-color 160ms ease;
}

.related-post-card:hover {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.22);
}

.related-post-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border: 1px solid var(--ink-line);
    border-radius: 4px;
    filter: saturate(0.96) brightness(0.78);
}

.related-post-card-body {
    display: grid;
    align-content: start;
    gap: var(--space-2);
    padding-top: var(--space-3);
}

.related-post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.related-post-meta time {
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.related-post-card h3 {
    margin: 0;
    color: #f5f6f7;
    font-size: clamp(1.08rem, 1.6vw, 1.32rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.related-post-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--ink-muted);
    font-size: 0.92rem;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.article-rail {
    position: sticky;
    top: 68px;
    align-self: start;
    height: calc(100vh - 68px);
    overflow-y: auto;
    border-left: 1px solid var(--ink-line);
    padding: var(--space-8) var(--space-6);
    scrollbar-width: thin;
    scrollbar-color: #737b86 transparent;
}

.article-rail section {
    border-bottom: 1px solid var(--ink-line);
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-6);
}

.article-rail h2 {
    margin: 0 0 var(--space-3);
    font-size: 1rem;
}

.article-rail p,
.article-rail a {
    color: var(--ink-muted);
    font-size: 0.92rem;
    line-height: 1.48;
}

@media (max-width: 980px) {
    .article-topbar {
        grid-template-columns: 1fr auto;
    }

    .article-nav {
        display: none;
    }

    .article-premium {
        grid-template-columns: 1fr;
    }

    .article-rail {
        position: static;
        height: auto;
        overflow: visible;
        border-top: 1px solid var(--ink-line);
        border-left: 0;
        padding: var(--space-6);
    }

    .related-posts {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .article-topbar {
        padding: 0 var(--space-4);
    }

    .article-logo {
        font-size: 1.55rem;
    }

    .article-premium-main {
        padding: var(--space-6) var(--space-4) 48px;
    }

    .article-premium-header h1 {
        font-size: clamp(2.2rem, 12vw, 3.4rem);
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .premium-body {
        font-size: 1rem;
        line-height: 1.62;
    }
}

/* Magazine news front page */
.magazine-body {
    min-height: 100vh;
    background: var(--ink-0);
    color: #f2f3f5;
}

.magazine-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(240px, 360px);
    align-items: center;
    gap: 28px;
    min-height: 68px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(5, 6, 7, 0.78);
    backdrop-filter: blur(18px) saturate(1.18);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035), 0 16px 32px rgba(0, 0, 0, 0.22);
    padding: 0 clamp(20px, 4vw, 64px);
}

.magazine-logo {
    font-family: var(--ui);
    font-size: clamp(1.65rem, 2.4vw, 2.25rem);
    font-weight: 850;
    letter-spacing: -0.04em;
}

.magazine-logo:hover,
.magazine-nav a:hover,
.read-link:hover {
    text-decoration: none;
}

.magazine-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 2.3vw, 34px);
    overflow-x: auto;
    color: #e6e8ea;
    scrollbar-width: none;
}

.magazine-nav a {
    position: relative;
    padding: 24px 0 21px;
    white-space: nowrap;
    font-family: var(--ui);
    font-size: 0.96rem;
}

.magazine-nav .active {
    color: #ffffff;
}

.magazine-nav .active::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #f2f3f5;
    content: "";
}

.magazine-search {
    position: relative;
}

.magazine-search label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.magazine-search input {
    width: 100%;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(15, 20, 25, 0.66);
    backdrop-filter: blur(12px);
    color: #f4f5f6;
    padding: 0 14px;
}

.magazine-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(288px, 344px);
    width: 100%;
    max-width: none;
    margin: 0;
    border-right: 1px solid var(--ink-line);
    border-left: 0;
    background: var(--ink-1);
}

.magazine-main {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: var(--space-6) var(--space-6) 40px;
}

.lead-story {
    display: grid;
    grid-template-columns: minmax(320px, 4fr) minmax(520px, 8fr);
    gap: var(--space-8);
    align-items: start;
    border-bottom: 1px solid var(--ink-line);
    padding-bottom: var(--space-4);
}

.story-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.story-meta span {
    color: #d7dce1;
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lead-copy h1 {
    margin: 8px 0 10px;
    max-width: 640px;
    font-family: var(--reader);
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
    font-weight: 850;
}

.lead-copy p,
.story-card p,
.brief-card p {
    color: var(--ink-soft);
    font-family: var(--reader);
}

.lead-copy p {
    max-width: 600px;
    margin: 0 0 8px;
    font-size: 0.9rem;
    line-height: 1.42;
}

.read-link {
    color: #eef2f6;
    font-size: 0.86rem;
    font-weight: 700;
}

.editorial-image {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--ink-line);
    border-radius: 3px;
    background:
        linear-gradient(135deg, #161b20, #090c0f 64%),
        repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.035) 18px 20px);
}

.editorial-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.68) contrast(1.08) saturate(0.86);
}

.editorial-image::after {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 45%),
        linear-gradient(180deg, rgba(5, 6, 7, 0.18), rgba(5, 6, 7, 0.08));
    content: "";
}

.editorial-image span {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 1;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lead-image {
    width: 100%;
    height: auto;
    min-height: 0;
}

.lead-story--text-only {
    grid-template-columns: minmax(0, 920px);
}

.lead-story--text-only .lead-copy h1 {
    max-width: 880px;
}

.lead-story--text-only .lead-copy p {
    max-width: 720px;
}

.top-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--ink-line);
}

.story-card {
    border-right: 1px solid var(--ink-line);
    padding: 16px 12px 14px 0;
}

.story-card + .story-card {
    padding-left: 12px;
}

.story-card:last-child {
    border-right: 0;
}

.card-image {
    width: 100%;
    height: auto;
    min-height: 0;
    margin-bottom: 8px;
}

.story-card h2 {
    margin: 6px 0 4px;
    font-family: var(--reader);
    font-size: 1.12rem;
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 820;
}

.story-card p {
    margin: 0 0 4px;
    font-size: 0.82rem;
    line-height: 1.38;
}

.brief-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--ink-line);
}

.brief-card {
    display: block;
    border-right: 1px solid var(--ink-line);
    padding: 16px 12px 14px 0;
}

.brief-card + .brief-card {
    padding-left: 12px;
}

.brief-card:last-child {
    border-right: 0;
}

.brief-thumb {
    width: 100%;
    height: auto;
    min-height: 0;
    margin-bottom: 8px;
}

.brief-card h3 {
    margin: 6px 0 4px;
    font-family: var(--reader);
    font-size: 1.12rem;
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 820;
}

.brief-card p {
    margin: 0 0 4px;
    font-size: 0.82rem;
    line-height: 1.38;
}

.magazine-sidebar {
    position: sticky;
    top: 68px;
    align-self: start;
    height: calc(100vh - 68px);
    overflow: hidden;
    border-left: 1px solid var(--ink-line);
    background: var(--ink-1);
    padding: 22px 28px 24px;
}

.side-block {
    border-bottom: 1px solid var(--ink-line);
    padding-bottom: 22px;
    margin-bottom: 24px;
}

.side-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.side-heading h2 {
    margin: 0;
    font-family: var(--reader);
    font-size: 1.22rem;
    letter-spacing: -0.03em;
}

.side-heading a {
    color: #dbe1e7;
    font-size: 0.9rem;
}

.latest-item {
    display: block;
    border-bottom: 1px solid var(--ink-line);
    padding: 12px 0;
}

.latest-item time {
    display: block;
    color: var(--ink-muted);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.latest-item strong {
    display: -webkit-box;
    overflow: hidden;
    font-family: var(--reader);
    font-size: 0.98rem;
    line-height: 1.18;
    letter-spacing: -0.015em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.topic-list {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topic-list li {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.topic-list li > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: var(--ink-3);
    color: #f4f5f6;
}

.topic-list strong,
.topic-list small {
    display: block;
}

.topic-list strong {
    line-height: 1.12;
}

.topic-list small,
.sidebar-empty {
    color: var(--ink-muted);
}

.magazine-empty {
    min-height: calc(100vh - 68px);
    padding: clamp(32px, 8vw, 88px);
}

.magazine-empty h1 {
    margin: 0 0 20px;
    font-family: var(--reader);
    font-size: clamp(2.2rem, 5.4vw, 4.2rem);
    letter-spacing: -0.055em;
    font-weight: 850;
}

.magazine-empty h2 {
    margin: 0 0 12px;
    font-family: var(--reader);
    font-size: clamp(1.5rem, 3.4vw, 2.35rem);
    letter-spacing: -0.04em;
}

.magazine-empty p {
    max-width: 680px;
    color: rgba(244, 245, 246, 0.72);
    font-size: 1.1rem;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.empty-actions a {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
}

@media (max-width: 1180px) {
    .magazine-topbar {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-block: 12px;
    }

    .magazine-nav {
        justify-content: flex-start;
    }

    .magazine-layout {
        grid-template-columns: 1fr;
    }

    .magazine-sidebar {
        position: static;
        height: auto;
        overflow: visible;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }
}

@media (max-width: 980px) {
    .magazine-main {
        max-width: 768px;
    }

    .lead-story {
        grid-template-columns: minmax(260px, 0.45fr) minmax(320px, 0.55fr);
    }

    .lead-copy h1 {
        font-size: clamp(1.85rem, 4vw, 2.4rem);
    }

    .lead-image {
        height: clamp(200px, 24vw, 280px);
    }

    .card-image {
        height: clamp(120px, 16vw, 152px);
    }
}

@media (max-width: 820px) {
    .lead-story,
    .top-grid,
    .brief-grid,
    .brief-card {
        grid-template-columns: 1fr;
    }

    .lead-image {
        height: clamp(184px, 48vw, 280px);
        min-height: 0;
    }

    .brief-thumb {
        width: 100%;
        height: var(--image-card-height);
    }

    .story-card,
    .story-card + .story-card,
    .brief-card,
    .brief-card + .brief-card {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding: 18px 0;
    }
}

@media (max-width: 720px) {
    :root {
        --image-lead-height: clamp(184px, 52vw, 260px);
        --image-card-height: clamp(156px, 48vw, 220px);
    }

    .magazine-topbar {
        grid-template-columns: 1fr;
        gap: 0;
        min-height: 0;
        padding: 10px 14px 0;
    }

    .magazine-logo {
        font-size: 1.7rem;
        line-height: 1;
        padding-bottom: 8px;
    }

    .magazine-nav {
        justify-content: flex-start;
        gap: 22px;
        width: calc(100% + 28px);
        margin-inline: -14px;
        padding-inline: 14px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .magazine-nav a {
        padding: 12px 0 13px;
        font-size: 0.92rem;
    }

    .magazine-search {
        display: none;
    }

    .magazine-layout,
    .article-premium,
    .editor-page-shell {
        display: block;
        min-height: auto;
    }

    .magazine-main,
    .article-premium-main {
        padding: 16px 14px 34px;
    }

    .lead-story {
        display: flex;
        flex-direction: column-reverse;
        gap: 14px;
        padding-bottom: 18px;
    }

    .lead-copy h1 {
        max-width: none;
        font-size: clamp(1.9rem, 9vw, 2.55rem);
        line-height: 1.02;
    }

    .lead-copy p {
        max-width: none;
        font-size: 0.95rem;
        line-height: 1.42;
    }

    .top-grid,
    .brief-grid {
        display: grid;
        grid-template-columns: 1fr;
        border-bottom: 0;
    }

    .story-card,
    .story-card + .story-card,
    .brief-card,
    .brief-card + .brief-card {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding: 18px 0;
    }

    .story-card h2,
    .brief-card h3 {
        font-size: 1.2rem;
        line-height: 1.08;
    }

    .story-card p,
    .brief-card p {
        font-size: 0.9rem;
        line-height: 1.38;
    }

    .card-image,
    .brief-thumb,
    .lead-image {
        width: 100%;
        height: auto;
        min-height: 0;
    }

    .magazine-sidebar {
        display: none;
    }

    .article-premium-header {
        padding-top: 4px;
    }

    .article-premium-header h1 {
        max-width: none;
        font-size: clamp(2rem, 10vw, 3rem);
        line-height: 1.03;
    }

    .article-premium-header .article-summary {
        max-width: none;
        font-size: 1rem;
        line-height: 1.44;
    }

    .premium-cover,
    .premium-body,
    .premium-module,
    .related-posts {
        max-width: none;
    }

    .premium-body {
        padding-top: 24px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .editor-page-shell .feed-header,
    .feed-header {
        position: static;
        min-height: auto;
        padding: 16px 14px;
    }

    .feed-header h1 {
        font-size: 1.32rem;
    }

    .article-form,
    .import-layout,
    .import-preview,
    .article-module {
        padding-inline: 14px;
    }

    .article-form {
        gap: 16px;
        padding-bottom: 30px;
    }

    .article-form input,
    .article-form textarea,
    .article-form select,
    .json-editor textarea {
        font-size: 16px;
    }

    .json-editor textarea {
        min-height: 320px;
    }

    .import-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .form-actions button,
    .form-actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .history-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .magazine-main,
    .article-premium-main,
    .article-form,
    .import-layout,
    .import-preview,
    .article-module {
        padding-inline: 12px;
    }

    .magazine-logo {
        font-size: 1.55rem;
    }

    .lead-copy h1,
    .article-premium-header h1 {
        letter-spacing: -0.035em;
    }
}
