:root {
    --bg: #FFFFFF;
    --bg2: #F7F7F5;
    --hover: #F2F2EF;
    --text: #111111;
    --text2: #6B6B6B;
    --text3: #767676;
    --line: #E7E7E4;
    --accent: #E53935;
    --accent-h: #C62828;
    --ok: #18864B;
    --card: #FFFFFF;
    --code-bg: rgba(0,0,0,.06);
}

[data-theme="dark"] {
    --bg: #121417;
    --bg2: #1B1E23;
    --hover: #23262C;
    --text: #E8EAED;
    --text2: #A3A9B3;
    --text3: #7A818C;
    --line: #2A2E35;
    --accent: #EF5350;
    --accent-h: #D84343;
    --ok: #4CAF7D;
    --card: #1B1E23;
    --code-bg: rgba(255,255,255,.08);
}

[data-theme="dark"] .md-content pre { background: #000; }
[data-theme="dark"] .search-overlay { background: rgba(18,20,23,.97); }
[data-theme="dark"] .toast { background: #E8EAED; color: #111; }
[data-theme="dark"] .notice.warn { background: #33270E; border-color: #6b4d16; color: #F5C36B; }
[data-theme="dark"] .notice.ok { background: var(--bg2); }
[data-theme="dark"] .pill.ok { background: #14261C; }
[data-theme="dark"] .pill.pill-or { background: #241A38; }
[data-theme="dark"] .pill.pill-ds { background: #0F2530; }
[data-theme="dark"] .role-badge.admin { background: #2E1715; }
[data-theme="dark"] .role-badge.editor { background: #14261C; }
[data-theme="dark"] .role-badge.role-reporter { background: #0F2530; }
[data-theme="dark"] .role-badge.role-fact-checker { background: #241A38; }
[data-theme="dark"] .like-btn.liked, [data-theme="dark"] .btn.like-btn.guest:hover { background: #2E1715; }
[data-theme="dark"] .test-result.ok { background: #14261C; }
[data-theme="dark"] .test-result.err { background: #2E1715; }
[data-theme="dark"] .provider-card.default { background: #14261C; }
[data-theme="dark"] tr.self td { background: var(--bg2); }
[data-theme="dark"] img { opacity: .92; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

.mono { font-family: 'IBM Plex Mono', 'Cascadia Mono', Consolas, monospace; }
.muted, .time { color: var(--text3); font-size: 12px; }

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

/* Header */
.site-header {
    height: 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    max-width: 1440px; margin: 0 auto; padding: 0 32px;
    height: 100%; display: flex; align-items: center; gap: 32px;
}
.logo { font-size: 23px; font-weight: 700; letter-spacing: 0.04em; }
.main-nav { display: flex; gap: 24px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { font-size: 14px; color: var(--text2); white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; transition: color .15s; }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-name { font-size: 14px; font-weight: 500; color: var(--text2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--bg2); }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 8px; color: var(--text); }

.container { max-width: 1440px; margin: 0 auto; padding: 24px 32px 64px; }

/* Breaking */
.breaking {
    max-width: 1440px; margin: 0 auto; padding: 8px 32px;
    display: flex; align-items: center; gap: 16px;
    color: var(--accent); border-bottom: 1px solid var(--line); font-size: 14px;
}
.breaking .mono { font-size: 11px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.breaking a:not(.mono) { flex: 1; font-weight: 500; color: var(--text); }
.breaking a:hover { color: var(--accent); }

/* Section titles */
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.section-title.small { font-size: 12px; }
.now-block { display: flex; align-items: baseline; gap: 16px; padding: 24px 0 16px; }
.cat-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.cat-label.small { font-size: 10px; }

.row-head { display: inline-flex; align-items: baseline; gap: 10px; }

/* Hero */
.hero-grid { display: grid; grid-template-columns: 65% 1fr; gap: 48px; padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.12; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 12px; }
.hero:hover img { opacity: .92; }
.lead-text { color: var(--text2); font-size: 17px; max-width: 60ch; }
.meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--text3); flex-wrap: wrap; }

.latest-col { border-left: 1px solid var(--line); padding-left: 32px; display: flex; flex-direction: column; }
.latest-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.latest-item:last-child { border-bottom: none; }
.latest-item .title { font-size: 15px; font-weight: 500; line-height: 1.35; }
.latest-item:hover .title { color: var(--accent); }

/* Digest */
.digest { padding: 40px 0; border-bottom: 1px solid var(--line); }
.big-title { font-size: clamp(22px, 2vw, 28px); font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.sub { color: var(--text2); font-size: 14px; margin-bottom: 20px; }
.sub a { text-decoration: underline; text-underline-offset: 3px; }
.digest-row { display: flex; align-items: baseline; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.digest-row .num { color: var(--accent); font-size: 12px; }
.digest-row .title { flex: 1; font-weight: 500; }
.digest-row:hover { background: var(--bg2); }
.digest-row .read { white-space: nowrap; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.filter { font-size: 13px; color: var(--text2); padding: 6px 12px; border: 1px solid transparent; border-radius: 6px; transition: all .15s; }
.filter:hover { background: var(--bg2); color: var(--text); }
.filter.on { color: var(--text); font-weight: 600; border-color: var(--line); background: var(--bg2); }
.filter.subscribed { color: #8a5b00; }
.filter.filter-sub { color: #8a5b00; border-color: rgba(138,91,0,.25); background: #FFFBF2; }
.filter.filter-sub:hover { color: #6b4700; }

/* Feed */
.feed { padding-top: 32px; }
.feed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 18px 12px; margin: 0 -12px; border-bottom: 1px solid var(--line); border-radius: 8px; transition: background .15s; animation: fadeIn .25s ease; }
.feed-row:hover { background: var(--bg2); }
.feed-main { display: flex; flex-direction: column; gap: 4px; }
.feed-title { font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.feed-lead { color: var(--text2); font-size: 14px; }
.thumb { width: 180px; height: 110px; object-fit: cover; border-radius: 8px; aspect-ratio: 18/11; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.empty-state { padding: 24px 12px; color: var(--text3); font-size: 15px; }
.empty-state a { text-decoration: underline; text-underline-offset: 3px; }

/* Article */
.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 300px; gap: 56px; justify-content: center; }
.article-title { font-size: clamp(30px, 3vw, 44px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 16px; }
figure img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; margin: 24px 0 8px; }
figcaption { color: var(--text3); font-size: 12px; }
.article-body p { margin: 16px 0; font-size: 17px; line-height: 1.7; }
.article-body h3 { margin: 28px 0 4px; font-size: 19px; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--ok); font-size: 14px; }
.check-list.small { font-size: 13px; }
.sources { margin-top: 40px; }
.sources h2 { font-size: 20px; margin-bottom: 8px; }
.source-row { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.source-row .num { color: var(--text3); font-size: 11px; }
.source-row span:nth-child(2) { flex: 1; font-size: 14px; }
.source-row a { text-decoration: underline; text-underline-offset: 3px; }
.source-row a:hover { color: var(--accent); }
.article-side { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 32px; }
.side-block h4 { font-size: 11px; letter-spacing: .12em; margin-bottom: 12px; color: var(--text3); }
.side-news { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.side-news:hover { color: var(--accent); }

/* (Newsroom �����) */
.newsroom .agents-list { margin-top: 16px; }
.agent-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.agent-row .desc { color: var(--text2); font-weight: 400; }
.agent-row.off { opacity: .55; }
.agent-row .off-status { color: var(--text3); }
.agent-row .ok { color: var(--ok); font-size: 12px; }

/* Search overlay */
.search-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.96); z-index: 200; padding: 80px 32px; }
.search-overlay.hidden { display: none; }
.search-box { max-width: 720px; margin: 0 auto; }
#search-input { width: 100%; font-size: 24px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; outline: none; }
.search-result-row { display: flex; flex-direction: column; padding: 14px 8px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 500; }
.search-result-row small { color: var(--text3); font-weight: 400; }
.search-result-row:hover { background: var(--bg2); }
.search-empty { padding: 20px 8px; color: var(--text3); font-size: 14px; }

/* Toast */
.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translate(-50%, 12px);
    background: var(--text); color: #fff;
    padding: 12px 22px; border-radius: 8px;
    font-size: 14px; z-index: 300;
    opacity: 0; transition: opacity .25s, transform .25s;
    pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; }
.footer-inner { display: flex; gap: 24px; font-size: 13px; color: var(--text2); flex-wrap: wrap; }
.footer-inner a:hover { color: var(--text); }

/* Admin */
.admin { max-width: 1240px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg); font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all .15s;
}
.btn:hover { background: var(--bg2); border-color: var(--text2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.danger { color: var(--accent); border-color: var(--accent); }
.btn.danger:hover { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }

/* Stats cards */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
    padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat-value.small { font-size: 17px; line-height: 1.3; }
.stat-label { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }

/* Notice */
.notice { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 20px; }
.notice.warn { background: #FFF4E5; border: 1px solid #FFD28A; color: #8a5b00; }
.notice.ok { background: var(--bg2); border: 1px solid var(--line); color: var(--text2); }
.notice code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; }
.notice a { text-decoration: underline; text-underline-offset: 2px; }

/* Table */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.admin-table th { text-align: left; font-size: 11px; letter-spacing: .1em; color: var(--text3); padding: 12px 14px; border-bottom: 1px solid var(--text); white-space: nowrap; }
.admin-table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover { background: var(--bg2); }
.admin-table tr.off td { color: var(--text3); }
.th-actions { width: 120px; text-align: right; }
td.actions-h { text-align: right; }

/* Pills & badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); border-color: rgba(24,134,75,.35); background: #E8F5E9; }
.pill.off { color: var(--text3); }
.pill.pill-or { color: #6b2bd6; border-color: rgba(107,43,214,.3); background: #F3EDFD; }
.pill.pill-ds { color: #0e7490; border-color: rgba(14,116,144,.3); background: #E6F6FA; }

/* Role badges */
.role-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--bg2); border: 1px solid var(--line); font-family: monospace; margin-right: 4px; }
.role-badge.admin { background: #FDECEA; color: var(--accent); border-color: var(--accent); }
.role-badge.editor { background: #E8F5E9; color: var(--ok); border-color: var(--ok); }
.role-badge.role-reporter { background: #E6F6FA; color: #0e7490; border-color: rgba(14,116,144,.3); }
.role-badge.role-fact-checker { background: #F3EDFD; color: #6b2bd6; border-color: rgba(107,43,214,.3); }
.role-badge.role-editor { background: #FFF4E5; color: #8a5b00; border-color: rgba(138,91,0,.3); }
tr.self td { background: var(--bg2); }

/* Actions (row) */
.actions { display: flex; flex-direction: column; gap: 6px; }
.actions-h { flex-direction: row; gap: 4px; justify-content: flex-end; }
.actions a, .link-btn { font-size: 13px; color: var(--text2); background: none; border: none; cursor: pointer; text-align: left; padding: 0; }
.actions a:hover, .link-btn:hover { color: var(--accent); }
.link-btn.danger:hover { color: var(--accent); }

/* Icon buttons */
.icon-btn { background: none; border: 1px solid transparent; cursor: pointer; font-size: 16px; padding: 6px; color: var(--text2); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; transition: all .12s; }
.icon-btn:hover { color: var(--text); background: var(--bg2); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--accent); background: #FDECEA; border-color: var(--accent); }

/* Form cards */
.agent-form { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.agent-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--text2); }
.agent-form input, .agent-form select, .agent-form textarea {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
    transition: border-color .12s;
}
.agent-form input:focus, .agent-form select:focus, .agent-form textarea:focus { outline: none; border-color: var(--text2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label.check { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form-group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); margin-bottom: 2px; }
.form-actions { display: flex; gap: 10px; }

/* Test result */
.test-result { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 2px; }
.test-result.ok { background: #E8F5E9; border: 1px solid rgba(24,134,75,.35); color: var(--ok); }
.test-result.err { background: #FDECEA; border: 1px solid rgba(229,57,53,.35); color: var(--accent); }
.test-result span { font-size: 13px; opacity: .85; }

/* Admin nav */
.admin-nav { display: flex; gap: 4px; margin: 16px 0 32px; border-bottom: 1px solid var(--line); padding-bottom: 12px; flex-wrap: wrap; align-items: center; }
.admin-nav a { font-size: 14px; color: var(--text2); padding: 7px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px; }
.admin-nav a:hover { background: var(--bg2); color: var(--text); }
.admin-nav a.on { background: var(--bg2); color: var(--text); font-weight: 600; }
.admin-nav .spacer { flex: 1; }

/* Auth & roles */
.auth-page { max-width: 460px; padding-top: 48px; }
.form-error { color: var(--accent); font-size: 13px; }
.nav-link-staff { font-size: 14px; color: var(--text2); white-space: nowrap; }
.nav-link-staff:hover { color: var(--text); }

/* Likes & comments */
.reactions { margin-top: 24px; display: flex; align-items: center; gap: 12px; }
.like-btn { font-size: 15px; cursor: pointer; }
.like-btn.liked { background: #FDECEA; border-color: var(--accent); color: var(--accent); }
.like-btn.guest:hover { background: #FDECEA; border-color: var(--accent); color: var(--accent); text-decoration: none; }
.like-hint { margin-top: 2px; }
.comments { margin-top: 40px; }
.comments h3 { margin-bottom: 16px; }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.comment-form textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; resize: vertical; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-head { font-size: 11px; color: var(--text3); letter-spacing: .06em; }
.comment-text { margin-top: 6px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.small-link { font-size: 11px; color: var(--text3); }
.small-link:hover { color: var(--accent); }
.subscribe-btn { margin-bottom: 16px; }

/* Markdown content */
.md-content h2, .md-content h3 { margin: 28px 0 8px; letter-spacing: -.01em; }
.md-content ul, .md-content ol { margin: 16px 0 16px 24px; }
.md-content li { margin: 6px 0; }
.md-content img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.md-content blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text2); margin: 16px 0; }
.md-content code { background: var(--bg2); padding: 2px 6px; border-radius: 4px; font-family: 'IBM Plex Mono', Consolas, monospace; font-size: .9em; }
.md-content pre { background: #111; color: #eee; padding: 16px; border-radius: 8px; overflow-x: auto; }
.md-content pre code { background: none; color: inherit; }
.md-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.md-content th, .md-content td { border: 1px solid var(--line); padding: 8px 10px; font-size: 14px; text-align: left; }
.md-content hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* Pager */
.pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.pager .filter.on { pointer-events: none; }
.pager-gap { color: var(--text3); font-size: 13px; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
    .hero-grid, .article-layout { grid-template-columns: 1fr; }
    .latest-col { border-left: none; padding-left: 0; }
    .feed-row { grid-template-columns: 1fr; }
    .thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
    .article-side { position: static; }
    .header-inner { padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 56px; }
    .container, .breaking { padding-left: 16px; padding-right: 16px; }
    .nav-toggle { display: inline-flex; order: 3; margin-left: auto; }
    .main-nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
        overflow: visible;
        border-top: 1px solid var(--line);
        padding-bottom: 8px;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 10px 0; border-bottom: none; font-size: 15px; }
    .header-actions { margin-left: auto; gap: 4px; }
    .user-name { display: none; }
    .search-overlay { padding: 40px 16px; }
    #search-input { font-size: 18px; padding: 12px 16px; }
    .agent-row { grid-template-columns: 1fr; gap: 8px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .row2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* Latest with thumbnails */
.latest-item.with-thumb { flex-direction: row; gap: 12px; align-items: flex-start; }
.latest-thumb { width: 84px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; aspect-ratio: 3/2; }
.latest-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.side-news.with-thumb { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.side-news-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.side-news .latest-thumb.small { width: 64px; height: 44px; }

/* Check row (single line) */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ok); flex-wrap: wrap; }
.check-row .sep { color: var(--text3); }

/* Image credits & studio extras */
.img-credit { display: block; font-size: 12px; color: var(--text3); font-style: italic; }
figcaption { color: var(--text3); font-size: 12px; font-style: italic; }
.image-preview { max-width: 340px; width: 100%; aspect-ratio: auto; border-radius: 8px; margin-top: 6px; }
.checks-grid { display: flex; flex-direction: column; gap: 10px; justify-content: center; }

/* EasyMDE theme fit */
.EasyMDEContainer .CodeMirror { border-radius: 8px; border-color: var(--line); }

/* Иконки панели редактора: рисуем текстом, не завися от шрифтовых библиотек */
.editor-toolbar { border-color: var(--line); background: var(--bg2); }
.editor-toolbar button {
    position: relative;
    width: 36px; height: 30px;
    border: none; background: none; cursor: pointer;
    color: var(--text2); border-radius: 6px;
    font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1;
}
.editor-toolbar button:hover { color: var(--accent); background: var(--hover); }
.editor-toolbar button.active { color: var(--accent); background: var(--hover); }
.editor-toolbar button::before {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.editor-toolbar button.bold::before          { content: "\0416"; font-weight: 800; }
.editor-toolbar button.italic::before        { content: "\041A"; font-style: italic; font-weight: 600; }
.editor-toolbar button.heading::before       { content: "H2"; font-weight: 800; font-size: 12px; letter-spacing: -.5px; }
.editor-toolbar button.unordered-list::before{ content: "\02022\02014"; font-size: 13px; }
.editor-toolbar button.ordered-list::before  { content: "1."; font-weight: 700; }
.editor-toolbar button.quote::before         { content: "\0275D"; font-size: 15px; }
.editor-toolbar button.link::before          { content: "\01F517"; font-size: 13px; }
.editor-toolbar button.image::before         { content: "\01F5BC"; font-size: 13px; }
.editor-toolbar button.preview::before       { content: "\01F441"; font-size: 13px; }
.editor-toolbar button.side-by-side::before  { content: "\025EB"; font-size: 16px; }
.editor-toolbar button.fullscreen::before    { content: "\026F6"; font-size: 16px; }.editor-toolbar i.separator { display: none; }

[data-theme="dark"] .EasyMDEContainer .CodeMirror { background: var(--bg2); color: var(--text); }
[data-theme="dark"] .EasyMDEContainer .CodeMirror-cursor { border-left-color: var(--text); }
[data-theme="dark"] .editor-toolbar { background: var(--bg2); border-color: var(--line); }
[data-theme="dark"] .editor-toolbar a { color: var(--text2); }
[data-theme="dark"] .editor-toolbar a.active, [data-theme="dark"] .editor-toolbar a:hover { color: var(--accent); border-color: var(--line); }
[data-theme="dark"] .editor-preview, [data-theme="dark"] .editor-preview-side { background: var(--bg); color: var(--text); }
[data-theme="dark"] .editor-statusbar { color: var(--text3); }

/* Theme toggle */
.theme-toggle svg { transition: transform .25s; }
.theme-toggle:hover svg { transform: rotate(20deg); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }

/* Category edit details */
.cat-edit summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-edit summary::-webkit-details-marker { display: none; }
.cat-edit summary .link-btn { margin-left: auto; }
.cat-edit-form { margin-top: 12px; max-width: none; }

.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Breaking rotator: кроссфейд без изменения layout */
.breaking-slot { flex: 1; position: relative; min-height: 1.5em; }
.breaking-item {
    position: absolute; top: 0; left: 0;
    width: 100%; font-weight: 500; color: var(--text);
    opacity: 0; pointer-events: none;
    transition: opacity .6s ease;
}
.breaking-item.on { opacity: 1; pointer-events: auto; }
.breaking a:hover { color: var(--accent); }

/* Reactions + check card on article page */
.reactions-block { align-items: stretch; gap: 20px; flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.reactions-left { display: flex; align-items: center; gap: 10px; }
.check-card { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.check-title { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--text3); }
.check-card .check-list li { color: var(--ok); }
.check-card .check-list li.muted { color: var(--text3); }
.small-btn { padding: 7px 14px; font-size: 13px; }

/* Comment likes */
.comment-foot { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.comment-like { font-size: 13px; color: var(--text3); }
.comment-like:hover, .comment-like.liked { color: var(--accent); }
.comment-like.liked { font-weight: 600; }
.warn-text { color: #8a5b00; }

/* Providers / categories admin */
.providers-layout { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; gap: 28px; align-items: start; }
.providers-list { display: flex; flex-direction: column; gap: 14px; }
.provider-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s; }
.provider-card:hover { border-color: var(--text2); }
.provider-card.default { border-color: rgba(24,134,75,.45); background: linear-gradient(0deg, rgba(232,245,233,.35), rgba(232,245,233,.35)), var(--bg); }
.provider-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.provider-actions { justify-content: flex-start; align-items: center; gap: 8px; }
.rename-details summary { cursor: pointer; list-style: none; }
.rename-details summary::-webkit-details-marker { display: none; }
.rename-form { display: flex; gap: 8px; margin-top: 8px; }
.rename-form input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

@media (max-width: 900px) {
    .providers-layout { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ==== Studio (news editor) ==== */
.hidden { display: none !important; }
.studio-eyebrow { display:block; font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--accent); margin-bottom:2px; }

/* --- Список: статистика и фильтры --- */
.studio-stats { grid-template-columns: repeat(5, 1fr); }
.studio-stats .stat-card {
    font: inherit; text-align: left; cursor: pointer; width: 100%;
    transition: border-color .15s, transform .1s, background .15s;
}
.studio-stats .stat-card:hover { border-color: var(--text2); transform: translateY(-1px); }
.studio-stats .stat-card.on { border-color: var(--accent); background: var(--bg); box-shadow: inset 0 0 0 1px var(--accent); }
.studio-stats .stat-card.on .stat-value { color: var(--accent); }

.studio-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    flex-wrap: wrap; margin-bottom: 18px;
}
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
    font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
    padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--bg); color: var(--text2); transition: all .12s;
}
.filter-tab:hover { background: var(--bg2); color: var(--text); }
.filter-tab.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.studio-toolbar-right { flex: 1; min-width: 220px; display: flex; justify-content: flex-end; }
.studio-search {
    width: 100%; max-width: 340px; padding: 9px 14px;
    border: 1px solid var(--line); border-radius: 999px; font: inherit;
    background: var(--bg); color: var(--text);
}
.studio-search:focus { outline: none; border-color: var(--text2); }
.studio-table td { vertical-align: middle; }
.cell-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cell-lead {
    margin-top: 4px; font-size: 13px; color: var(--text3);
    max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.pill-row { display: flex; gap: 5px; flex-wrap: wrap; }
.studio-empty { padding: 28px 0; text-align: center; color: var(--text3); font-size: 14px; }

/* --- Форма: двухколоночная раскладка --- */
.studio-form { display: block; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.studio-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.studio-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.studio-form input:not([type="checkbox"]), .studio-form select, .studio-form textarea {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    font: inherit; color: var(--text); background: var(--bg); width: 100%;
}
.studio-form input:not([type="checkbox"]):focus, .studio-form select:focus, .studio-form textarea:focus {
    outline: none; border-color: var(--text2);
}
.studio-form select { cursor: pointer; }
.studio-editor-card { gap: 10px; }
.studio-title {
    font-family: 'IBM Plex Serif', Georgia, serif; font-size: 24px; font-weight: 600;
    letter-spacing: -.02em; padding: 12px 14px !important;
}
.studio-form textarea#Lead { resize: vertical; font-size: 15px; }
.field-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 11px; color: var(--text3); }
.field-foot .over { color: var(--accent); }
.field-hint { font-size: 11px; color: var(--text3); }

.editor-toolbar-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.editor-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mode-btn {
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    padding: 5px 12px; border: none; background: var(--bg); color: var(--text2);
}
.mode-btn + .mode-btn { border-left: 1px solid var(--line); }
.mode-btn.on { background: var(--text); color: var(--bg); }
.studio-editor { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.studio-editor .toastui-editor-defaultUI { border: none; }
.studio-editor .toastui-editor-toolbar { background: var(--bg2); }
.studio-editor .toastui-editor-contents { font-family: 'Inter', sans-serif; font-size: 16px; }
.studio-editor .toastui-editor-md-tab-container, .studio-editor .toastui-editor-md-container .toastui-editor { background: var(--bg); }
.fallback-editor { min-height: 420px; resize: vertical; font-family: 'IBM Plex Mono', monospace; font-size: 14px; }

/* Переключатель публикации */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    position: relative; width: 46px; height: 26px; border-radius: 999px;
    background: var(--line); transition: background .18s; flex-shrink: 0;
}
.switch-thumb {
    position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; }
.switch-text strong { font-size: 14px; }
.switch-text small { color: var(--text3); font-size: 12px; }
.side-meta { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-meta .mono { font-size: 12px; color: var(--text2); word-break: break-all; }

.flag-breaking span { font-weight: 600; }
.flag-note { color: var(--text3); font-size: 11px; margin-left: auto; }
.cover-preview { margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.cover-preview img { width: 100%; border-radius: 8px; aspect-ratio: 16/9; object-fit: cover; }
.cover-preview figcaption { font-size: 11px; color: var(--text3); font-style: italic; }

/* Нижняя панель действий */
.studio-actions {
    position: sticky; bottom: 0; z-index: 40; margin-top: 20px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 16px; background: var(--bg2);
    border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 -2px 14px rgba(0,0,0,.06);
}
.studio-actions-spacer { flex: 1; }

@media (max-width: 980px) {
    .studio-layout { grid-template-columns: 1fr; }
    .studio-side { position: static; }
    .studio-toolbar-right { justify-content: stretch; }
    .studio-search { max-width: none; }
}
@media (max-width: 700px) {
    .studio-stats { grid-template-columns: repeat(2, 1fr); }
    .studio-actions { position: static; }
    .studio-actions .btn { flex: 1; justify-content: center; }
}


