/* ============================================================
   TopReq — дизайн-система.
   Токены взяты из прототипа TopReq.dc.html, чтобы вёрстка сайта
   совпадала с утверждённым макетом.
   ============================================================ */

:root {
    /* Поверхности */
    --bg: #f2f2f5;
    --surface: #fff;
    --surface-2: #f4f4f7;
    --surface-3: #f6f6f9;
    --surface-hover: #eaeaf0;

    /* Текст */
    --text: #1c1c22;
    --text-2: #33333c;
    --text-3: #4d4d57;
    --text-muted: #6e6e79;
    --text-soft: #8a8a95;
    --text-faint: #9a9aa5;
    --placeholder: #a4a4b0;

    /* Границы */
    --border: #ebebf0;
    --border-strong: #e2e2e9;
    --hairline: #f1f1f5;
    --border-hover: #c9c9d4;

    /* Акцент */
    --accent: #6b4ddb;
    --accent-hover: #5c3fce;
    --accent-text: #5c3fce;
    --accent-deep: #4b30ad;
    --accent-soft: #f0ecfd;
    --accent-soft-2: #e4dcfb;
    --accent-line: #b7a4f5;

    /* Статусы */
    --green: #2fa85c;
    --green-soft: #eaf7ef;
    --red: #d9553a;
    --red-soft: #fdeeea;
    --orange: #b8621f;
    --orange-soft: #fdf0e6;

    /* Скругления */
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 12px;
    --r-xl: 14px;
    --r-2xl: 18px;
    --r-3xl: 20px;

    --shadow-sm: 0 1px 2px rgba(28, 28, 34, .06);
    --shadow-md: 0 6px 24px rgba(28, 28, 34, .10);
    --shadow-lg: 0 18px 48px rgba(28, 28, 34, .18);

    --header-h: 64px;
    --max-w: 1560px;

    --font: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

input, textarea, button, select { font-family: inherit; font-size: inherit; }
textarea { resize: vertical; }
::placeholder { color: var(--placeholder); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; text-wrap: pretty; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-faint); }
.secondary { color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Шапка ---------- */

.header {
    position: sticky; top: 0; z-index: 40;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex; align-items: center;
    padding: 0 24px; gap: 20px;
}

.header__logo { display: flex; align-items: center; gap: 10px; flex: none; }
.header__logo img { height: 28px; width: auto; display: block; }

.header__search {
    display: flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 14px;
    border-radius: var(--r-lg);
    background: var(--surface-2);
    min-width: 220px; flex: 0 1 420px;
}
.header__search input {
    border: 0; outline: 0; background: transparent;
    font-size: 14px; width: 100%; color: var(--text);
}
.header__search svg { flex: none; color: var(--text-faint); }

.header__actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.icon-btn {
    position: relative; width: 36px; height: 36px; flex: none;
    border: 0; border-radius: var(--r-md);
    background: var(--surface-2); color: var(--text-3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); }
.icon-btn__dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--surface-2);
}

.header__user {
    display: flex; align-items: center; flex: none;
    padding: 0; border: 0; background: transparent;
    cursor: pointer; border-radius: 50%;
    transition: opacity .12s ease;
}
.header__user:hover { opacity: .85; }
.header__user:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.burger { display: none; }

/* ---------- Аватар ---------- */

.avatar {
    border-radius: 50%; flex: none; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--accent { background: linear-gradient(135deg, #d9d0fb, #b7a4f5); color: var(--accent-deep); }
.avatar--xs { width: 24px; height: 24px; font-size: 10.5px; }
.avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.avatar--md { width: 34px; height: 34px; font-size: 12px; }
.avatar--lg { width: 38px; height: 38px; font-size: 13px; }
.avatar--xl { width: 72px; height: 72px; font-size: 24px; }

/* ---------- Каркас страницы ---------- */

.shell { display: flex; align-items: flex-start; gap: 0; max-width: var(--max-w); margin: 0 auto; }

.sidebar {
    width: 236px; flex: none;
    padding: 20px 12px 40px 16px;
    position: sticky; top: var(--header-h); align-self: flex-start;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}

.main { flex: 1; min-width: 0; padding: 20px 24px 64px 12px; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    height: 44px; padding: 0 14px;
    border-radius: var(--r-lg); margin-bottom: 2px;
    font-size: 15px; color: var(--text-3); font-weight: 500;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-3); }
.nav-item.is-active {
    background: var(--surface); color: var(--text);
    font-weight: 600; box-shadow: var(--shadow-sm);
}
.nav-item svg { flex: none; opacity: .9; }

.sidebar__divider { height: 1px; background: #e6e6ec; margin: 16px 14px; }

.sidebar__title {
    padding: 0 14px; margin-bottom: 10px;
    font-size: 12px; font-weight: 600; color: #9a9aa8;
    letter-spacing: .04em; text-transform: uppercase;
}

.rubric-item {
    display: flex; align-items: center; justify-content: space-between;
    height: 38px; padding: 0 14px; border-radius: var(--r-md);
    font-size: 14px; color: #5d5d69;
}
.rubric-item:hover { background: var(--surface-hover); color: var(--text-2); }
.rubric-item.is-active { background: var(--surface); color: var(--text); font-weight: 600; }
.rubric-item__count { font-size: 12px; color: var(--placeholder); font-family: var(--mono); }

/* ---------- Карточки ---------- */

.card {
    background: var(--surface);
    border-radius: var(--r-2xl);
    padding: 22px 24px;
}
.card--tight { padding: 20px 22px; }
.card--flat { padding: 0; overflow: hidden; }
.card--accent { background: var(--accent-soft); }

.card__title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 18px;
    border: 0; border-radius: var(--r-lg);
    font-size: 14.5px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

.btn--ghost { background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong); }
.btn--ghost:hover { border-color: var(--border-hover); color: var(--text-2); }

.btn--soft { background: var(--surface-3); color: var(--text-3); }
.btn--soft:hover { background: var(--surface-hover); color: var(--text-3); }

.btn--danger { background: var(--red-soft); color: var(--red); }
.btn--danger:hover { background: #fbe0d9; color: var(--red); }

.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r-md); }
.btn--lg { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: var(--r-xl); }
.btn--block { width: 100%; }

/* ---------- Бейджи и пилюли ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 7px;
    height: 24px; padding: 0 10px;
    border-radius: var(--r-sm);
    font-size: 12px; font-weight: 600;
    background: var(--surface-2); color: var(--text-muted);
}
.badge--accent { background: var(--accent-soft); color: var(--accent-text); }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--orange { background: var(--orange-soft); color: var(--orange); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--lg { height: 26px; font-size: 12.5px; }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tabs {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border-radius: var(--r-xl);
    padding: 12px 14px; flex-wrap: wrap;
}
.tab {
    height: 38px; padding: 0 18px; border-radius: var(--r-md);
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text-3); font-weight: 500;
    background: transparent; border: 0; cursor: pointer;
}
.tab:hover { background: var(--surface-2); color: var(--text-3); }
.tab.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.tab__count { font-family: var(--mono); font-size: 12.5px; opacity: .6; }

.chip {
    display: inline-flex; align-items: center;
    height: 26px; padding: 0 10px; border-radius: var(--r-sm);
    background: var(--surface-2); color: var(--text-muted);
    font-size: 12.5px;
}
.chip:hover { background: var(--surface-hover); color: var(--text-2); }

/* ---------- Формы ---------- */

.field { display: block; margin-bottom: 14px; }
.field__label { display: block; font-size: 13.5px; color: var(--text-muted); margin-bottom: 7px; }
.field__hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.field__error { font-size: 12.5px; color: var(--red); margin-top: 6px; min-height: 1px; }

.input, .textarea, .select {
    width: 100%; height: 48px;
    border: 1px solid var(--border-strong); border-radius: var(--r-lg);
    padding: 0 15px; font-size: 15px; outline: none;
    color: var(--text); background: var(--surface);
}
.textarea { height: auto; padding: 14px 16px; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent-line); }
.input.is-invalid, .textarea.is-invalid { border-color: #eaa79b; }
.input--sm { height: 42px; border-radius: var(--r-md); font-size: 14.5px; }

.checkbox { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox__box {
    width: 20px; height: 20px; border-radius: 6px; flex: none; margin-top: 1px;
    border: 1.6px solid #d5d5de; background: var(--surface);
    display: flex; align-items: center; justify-content: center;
}
.checkbox input:checked + .checkbox__box { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked + .checkbox__box svg { color: #fff; }
.checkbox__box svg { color: transparent; }
.checkbox__text { font-size: 13.5px; color: var(--text-muted); line-height: 1.45; }

.divider-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider-or span { font-size: 12.5px; color: var(--placeholder); }

/* ---------- Сообщения ---------- */

.alert {
    border-radius: var(--r-xl); padding: 14px 16px;
    font-size: 14.5px; line-height: 1.5;
    display: flex; gap: 10px; align-items: flex-start;
}
.alert--info { background: var(--accent-soft); color: var(--accent-deep); }
.alert--success { background: var(--green-soft); color: #1f7a41; }
.alert--warning { background: var(--orange-soft); color: var(--orange); }
.alert--error { background: var(--red-soft); color: #a83c25; }

.empty {
    text-align: center; padding: 56px 24px;
    color: var(--text-faint);
}
.empty__title { font-size: 17px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }

/* ---------- Лента ---------- */

.feed { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.feed__main { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.feed__aside { flex: 1 1 300px; min-width: 280px; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }

.hero {
    background: var(--surface); border-radius: var(--r-2xl);
    padding: 24px 26px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
}
.hero__body { flex: 1 1 320px; min-width: 0; }
.hero__title { font-size: 27px; font-weight: 700; line-height: 1.2; }
.hero__title a { color: inherit; }
.hero__title a:hover { color: var(--accent-hover); }
.hero__excerpt { margin-top: 10px; font-size: 15px; color: var(--text-muted); line-height: 1.5; }
.hero__cover {
    flex: 1 1 240px; min-width: 200px; max-width: 320px; height: 168px;
    border-radius: var(--r-xl); overflow: hidden;
}

.post-card { background: var(--surface); border-radius: var(--r-2xl); padding: 22px 24px; }
.post-card__top {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
    font-size: 13px; color: var(--text-soft); flex-wrap: wrap;
}
.post-card__body { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.post-card__text { flex: 1 1 260px; min-width: 0; }
.post-card__title { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--accent-hover); }
.post-card__excerpt { margin-top: 8px; font-size: 15px; color: var(--text-muted); line-height: 1.55; }
.post-card__tags { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.post-card__thumb {
    flex: 0 1 168px; min-width: 120px; height: 112px;
    border-radius: var(--r-lg); overflow: hidden;
}
.post-card__footer {
    display: flex; align-items: center; gap: 10px;
    margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--hairline); flex-wrap: wrap;
}
.post-card__author { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-muted); min-width: 0; }
.post-card__author a { color: var(--text-muted); }
.post-card__author a:hover { color: var(--accent); }

.cover-placeholder {
    width: 100%; height: 100%;
    background: repeating-linear-gradient(135deg, #ededf2 0 8px, #f7f7fa 8px 16px);
    border: 1px solid #eaeaef; border-radius: inherit;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-faint); font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
}
.cover-placeholder img { width: 100%; height: 100%; object-fit: cover; }

/* Голосование */

.vote {
    display: flex; align-items: center; gap: 2px;
    height: 34px; padding: 0 6px;
    border-radius: var(--r-md); background: var(--surface-3);
}
.vote__btn {
    width: 26px; height: 26px; border: 0; background: transparent;
    border-radius: var(--r-sm); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--placeholder);
}
.vote__btn:hover { background: var(--surface-hover); }
.vote__btn.is-on--up { color: var(--green); }
.vote__btn.is-on--down { color: var(--red); }
.vote__score {
    min-width: 44px; text-align: center;
    font-size: 14px; font-weight: 600; font-family: var(--mono); color: #75757e;
}
.vote__score.is-positive { color: var(--green); }
.vote__score.is-negative { color: var(--red); }

.vote--lg { height: 46px; padding: 0 8px; border-radius: var(--r-xl); }
.vote--lg .vote__btn { width: 34px; height: 34px; border-radius: var(--r-md); }
.vote--lg .vote__score { min-width: 62px; font-size: 17px; font-weight: 700; }

.meta-btn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 12px;
    border: 0; border-radius: var(--r-md); background: var(--surface-3);
    font-size: 13.5px; color: var(--text-3); cursor: pointer;
}
.meta-btn:hover { background: var(--surface-hover); color: var(--text-3); }
.meta-btn.is-on { background: var(--accent-soft); color: var(--accent-text); }
.meta-btn__num { font-family: var(--mono); }

/* ---------- Правая колонка ---------- */

.trend-row {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--hairline);
}
.trend-row:last-child { border-bottom: 0; }
.trend-row__n { font-family: var(--mono); font-size: 13px; color: #b9b9c4; width: 18px; flex: none; }
.trend-row__title { display: block; font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--text); }
.trend-row__meta { display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 4px; font-family: var(--mono); }
.trend-row__delta { font-size: 12.5px; font-weight: 600; font-family: var(--mono); flex: none; white-space: nowrap; }
.delta--up { color: var(--green); }
.delta--down { color: var(--red); }

.author-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.author-row__name { font-size: 14px; font-weight: 500; }
.author-row__meta { font-size: 12.5px; color: var(--text-faint); }
.author-row__rating { font-size: 13px; font-weight: 600; color: var(--green); font-family: var(--mono); }

/* ---------- Статья ---------- */

.article-layout { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.article {
    flex: 1 1 560px; min-width: 0;
    background: var(--surface); border-radius: var(--r-2xl);
    padding: 36px 44px 32px;
}
.article__aside {
    flex: 1 1 300px; min-width: 280px; max-width: 340px;
    display: flex; flex-direction: column; gap: 12px;
    position: sticky; top: calc(var(--header-h) + 20px);
}

.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); margin-bottom: 18px; flex-wrap: wrap; }

.article__title { font-size: 40px; line-height: 1.12; letter-spacing: -.025em; }
.article__meta {
    display: flex; align-items: center; gap: 18px;
    margin-top: 22px; padding-bottom: 24px;
    border-bottom: 1px solid var(--hairline);
    font-size: 13.5px; color: var(--text-soft); flex-wrap: wrap;
}
.article__lead { font-size: 19px; line-height: 1.6; color: var(--text-2); margin: 26px 0 0; }
.article__cover { margin: 26px 0; border-radius: var(--r-xl); overflow: hidden; }

.article__actions {
    display: flex; align-items: center; gap: 12px;
    margin-top: 30px; padding-top: 24px;
    border-top: 1px solid var(--hairline); flex-wrap: wrap;
}

/* Тело публикации: единые стили для HTML из редактора */

.prose { font-size: 17px; line-height: 1.65; color: #40404a; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 14px; text-wrap: pretty; }
.prose h2 { font-size: 25px; margin: 34px 0 12px; color: var(--text); letter-spacing: -.015em; }
.prose h3 { font-size: 20px; margin: 26px 0 10px; color: var(--text); letter-spacing: -.01em; }
.prose h4 { font-size: 17px; margin: 22px 0 8px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose blockquote {
    margin: 20px 0; padding: 4px 0 4px 18px;
    border-left: 3px solid var(--accent-line);
    color: var(--text-muted); font-style: normal;
}
.prose img { border-radius: var(--r-lg); display: block; margin: 20px auto; }
.prose figure { margin: 22px 0; }
.prose figcaption { font-size: 13.5px; color: var(--text-faint); text-align: center; margin-top: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.prose code {
    font-family: var(--mono); font-size: 14px;
    background: var(--surface-3); padding: 2px 6px; border-radius: 6px;
}
.prose pre {
    background: var(--surface-3); border-radius: var(--r-lg);
    padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 14px;
}
.prose pre code { background: none; padding: 0; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--r-lg); display: block; margin: 22px 0; }

.table-scroll { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--r-xl); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.cmp-table th {
    background: var(--surface-3); padding: 12px 16px; text-align: left;
    font-size: 12.5px; font-weight: 600; color: var(--text-muted);
    letter-spacing: .03em; text-transform: uppercase;
}
.cmp-table td { padding: 14px 16px; border-top: 1px solid var(--hairline); }
.cmp-table td:first-child { font-weight: 600; color: var(--text); }
.cmp-table td:not(:first-child) { font-family: var(--mono); color: #40404a; }

/* Блок «Позиция топа» */

.top-item { margin-top: 26px; border: 1px solid var(--border); border-radius: var(--r-2xl); padding: 24px; }
.top-item__head { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.top-item__num {
    flex: none; width: 44px; height: 44px; border-radius: var(--r-lg);
    background: var(--accent-soft); color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; font-weight: 700; font-family: var(--mono);
}
.top-item__body { flex: 1; min-width: 0; }
.top-item__name { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }
.top-item__role { font-size: 14px; color: var(--text-soft); }
.top-item__media { flex: 0 1 180px; min-width: 140px; }
.top-item__cols { display: flex; gap: 24px; flex-wrap: wrap; }
.top-item__pros, .top-item__cons { flex: 1; min-width: 220px; }
.top-item__pros > b, .top-item__cons > b {
    display: block; font-size: 12px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px;
}
.top-item__pros > b { color: var(--green); }
.top-item__cons > b { color: var(--red); }
.top-item__pros ul, .top-item__cons ul { list-style: none; padding: 0; margin: 0; }
.top-item__pros li, .top-item__cons li {
    display: flex; gap: 10px; font-size: 15px; color: #40404a; line-height: 1.5; margin-bottom: 6px;
}
.top-item__pros li::before, .top-item__cons li::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; margin-top: 8px; flex: none;
}
.top-item__pros li::before { background: var(--green); }
.top-item__cons li::before { background: var(--red); }
.top-item__price {
    margin-top: 16px; display: inline-flex; align-items: center; gap: 10px;
    height: 38px; padding: 0 14px; border-radius: var(--r-lg);
    background: var(--surface-3); font-size: 14px; font-weight: 600; color: var(--text-2);
}

/* FAQ */

.faq { margin-top: 34px; background: var(--surface-3); border-radius: var(--r-2xl); padding: 24px 26px; }
.faq > b { display: block; font-size: 18px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.faq-item { padding: 16px 0; border-bottom: 1px solid #e8e8ee; }
.faq-item:last-child { border-bottom: 0; }
.faq-item h3, .faq-item__q { font-size: 15.5px; font-weight: 600; color: var(--text); margin: 0; }
.faq-item__a, .faq-item > div { font-size: 15px; color: #55555f; line-height: 1.55; margin-top: 6px; }

/* Скрытая ссылка */

.lnk-hidden {
    color: var(--text-muted);
    border-bottom: 1px dashed var(--placeholder);
    cursor: help; white-space: nowrap;
}
.lnk-hidden::after {
    content: "";
    display: inline-block; width: 11px; height: 12px; margin-left: 4px; vertical-align: -1px;
    background: currentColor; opacity: .55;
    -webkit-mask: var(--lock-mask) center / contain no-repeat;
    mask: var(--lock-mask) center / contain no-repeat;
}
:root {
    --lock-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 12'%3E%3Cpath d='M2 5V3.4a3.5 3.5 0 0 1 7 0V5h.6a.9.9 0 0 1 .9.9v5.2a.9.9 0 0 1-.9.9H1.4a.9.9 0 0 1-.9-.9V5.9A.9.9 0 0 1 1.4 5H2Zm1.6 0h3.8V3.4a1.9 1.9 0 0 0-3.8 0V5Z'/%3E%3C/svg%3E");
}

/* Оглавление */

.toc__title {
    font-size: 13px; font-weight: 600; color: #9a9aa8;
    letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px;
}
.toc__link { display: block; font-size: 14.5px; color: #5d5d69; padding: 7px 0; line-height: 1.4; }
.toc__link:hover { color: var(--accent); }
.toc__link.is-active { color: var(--text); font-weight: 600; }
.toc__link--sub { padding-left: 14px; font-size: 14px; }

/* ---------- Комментарии ---------- */

.comments { background: var(--surface); border-radius: var(--r-2xl); padding: 28px 44px 32px; margin-top: 12px; }
.comments__head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.comments__title { font-size: 22px; font-weight: 700; letter-spacing: -.015em; }

.comment { padding: 18px 0; border-top: 1px solid var(--hairline); }
.comment__row { display: flex; gap: 14px; }
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-faint); flex-wrap: wrap; }
.comment__author { font-size: 14.5px; font-weight: 600; color: var(--text); }
.comment__text { font-size: 15.5px; line-height: 1.6; color: var(--text-2); margin-top: 6px; }
.comment__text p { margin: 0 0 10px; }
.comment__text p:last-child { margin-bottom: 0; }
.comment__actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 13.5px; color: var(--text-soft); }
.comment__reply { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-soft); font-size: 13.5px; }
.comment__reply:hover { color: var(--accent); }
.comment__replies { margin-top: 16px; border-left: 2px solid var(--hairline); padding-left: 18px; }
.comment__replies .comment { border-top: 0; padding: 12px 0 0; }

.comment-vote { display: flex; align-items: center; gap: 8px; }
.comment-vote button { background: none; border: 0; padding: 2px; cursor: pointer; color: #c4c4ce; }
.comment-vote button:hover { opacity: .7; }
.comment-vote button.is-on--up { color: var(--green); }
.comment-vote button.is-on--down { color: var(--red); }
.comment-vote__score { font-family: var(--mono); font-weight: 600; color: #75757e; }

/* ---------- Кабинет и таблицы ---------- */

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.page-subtitle { font-size: 15px; color: var(--text-muted); margin-top: 6px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: var(--r-2xl); padding: 20px 22px; }
.stat__label { font-size: 13.5px; color: var(--text-soft); }
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-family: var(--mono); white-space: nowrap; }
.stat__delta { font-size: 13.5px; font-weight: 600; font-family: var(--mono); white-space: nowrap; }

.data-table { width: 100%; }
.data-table__head {
    display: grid; background: var(--surface-3); border-radius: var(--r-lg);
    font-size: 12.5px; font-weight: 600; color: var(--text-muted);
    letter-spacing: .03em; text-transform: uppercase;
}
.data-table__head > div { padding: 11px 12px; }
.data-table__row {
    display: grid; align-items: center;
    border-bottom: 1px solid var(--hairline); font-size: 14.5px;
}
.data-table__row > div { padding: 16px 12px; }
.data-table__row:hover { background: #fafafc; }
.data-table__main { font-weight: 600; line-height: 1.35; }
.data-table__meta { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; }
.data-table__num { font-family: var(--mono); color: #40404a; }

.mini-btn {
    width: 32px; height: 32px; border: 0; border-radius: 9px;
    background: var(--surface-3); color: #75757e;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.mini-btn:hover { background: var(--surface-hover); }
.mini-btn--danger:hover { background: var(--red-soft); color: var(--red); }

/* ---------- Баланс ---------- */

.wallet-hero {
    background: var(--surface); border-radius: var(--r-2xl); padding: 26px 28px;
    display: flex; gap: 32px; align-items: center; flex-wrap: wrap;
}
.wallet-hero__amount { font-size: 38px; font-weight: 700; font-family: var(--mono); letter-spacing: -.02em; }
.wallet-hero__label { font-size: 13.5px; color: var(--text-soft); }
.wallet-hero__held { font-size: 15px; color: var(--orange); font-family: var(--mono); }

.amount-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.amount-preset {
    height: 42px; padding: 0 16px; border-radius: var(--r-md);
    border: 1px solid var(--border-strong); background: var(--surface);
    font-size: 14.5px; font-weight: 600; color: var(--text-2);
    font-family: var(--mono); cursor: pointer;
}
.amount-preset:hover { border-color: var(--border-hover); }
.amount-preset.is-active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

.tx-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid var(--hairline);
}
.tx-row__title { font-size: 14.5px; font-weight: 500; }
.tx-row__meta { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; }
.tx-row__amount { font-family: var(--mono); font-weight: 600; font-size: 15px; margin-left: auto; white-space: nowrap; }
.tx-row__amount.is-plus { color: var(--green); }
.tx-row__amount.is-minus { color: var(--text-2); }
.tx-row__balance { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); }

/* ---------- Редактор ---------- */

.editor-layout { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.editor-main { flex: 1 1 520px; min-width: 0; background: var(--surface); border-radius: var(--r-2xl); padding: 28px 32px 32px; }
.editor-aside { flex: 1 1 320px; min-width: 300px; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }

.editor-title {
    width: 100%; border: 0; outline: 0; padding: 0 0 14px;
    font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--text);
}

.toolbar {
    display: flex; align-items: center; gap: 6px;
    padding: 8px; background: var(--surface-3);
    border-radius: var(--r-lg); margin-bottom: 16px; flex-wrap: wrap;
    position: sticky; top: calc(var(--header-h) + 4px); z-index: 5;
}
.toolbar__btn {
    height: 34px; min-width: 34px; padding: 0 11px;
    border: 0; border-radius: 9px; background: var(--surface);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13.5px; font-weight: 600; color: var(--text-3); cursor: pointer;
}
.toolbar__btn:hover { background: #eeeef3; }
.toolbar__btn.is-active { background: var(--accent-soft); color: var(--accent-text); }
.toolbar__sep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 2px; }

.editor-surface {
    border: 1px solid var(--border-strong); border-radius: var(--r-xl);
    padding: 22px 24px; min-height: 420px;
}
.editor-surface:focus-within { border-color: var(--accent-line); }
.editor-surface .ProseMirror { outline: none; min-height: 380px; }
.editor-surface .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder); float: left; height: 0;
    color: var(--placeholder); pointer-events: none;
}

.editor-html {
    width: 100%; min-height: 420px; font-family: var(--mono); font-size: 14px; line-height: 1.6;
    border: 1px solid var(--border-strong); border-radius: var(--r-xl); padding: 18px 20px; outline: none;
}

.aside-title {
    font-size: 13px; font-weight: 600; color: #9a9aa8;
    letter-spacing: .04em; text-transform: uppercase; margin-bottom: 12px;
}

.dropzone {
    height: 150px; border: 1px dashed #d5d5de; border-radius: var(--r-lg);
    background: repeating-linear-gradient(135deg, #ededf2 0 8px, #f7f7fa 8px 16px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    color: var(--text-faint); cursor: pointer; overflow: hidden;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone img { width: 100%; height: 100%; object-fit: cover; }

.seo-preview { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; }
.seo-preview__title { font-size: 14.5px; color: var(--accent-deep); line-height: 1.35; }
.seo-preview__url { font-size: 12.5px; color: var(--green); margin-top: 4px; font-family: var(--mono); word-break: break-all; }
.seo-preview__desc { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.45; }

/* Панель ссылок */

.link-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 0; border-bottom: 1px solid var(--hairline);
}
.link-row:last-child { border-bottom: 0; }
.link-row__host { font-size: 14px; font-weight: 600; word-break: break-all; }
.link-row__url { font-size: 12.5px; color: var(--text-faint); font-family: var(--mono); word-break: break-all; margin-top: 2px; }
.link-row__status { font-size: 12.5px; margin-top: 4px; }

.links-total {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
    font-size: 15px; font-weight: 600;
}
.links-total__sum { font-family: var(--mono); }

/* ---------- Модальное окно ---------- */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(28, 28, 34, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
    background: var(--surface); border-radius: var(--r-3xl);
    width: 100%; max-width: 560px; padding: 28px 30px;
    box-shadow: var(--shadow-lg); margin: auto;
}
.modal__title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.modal__text { font-size: 15px; color: var(--text-muted); line-height: 1.55; }
.modal__actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Подвал ---------- */

.footer {
    border-top: 1px solid var(--border); background: var(--surface);
    margin-top: 40px; padding: 36px 24px 40px;
}
.footer__inner { max-width: var(--max-w); margin: 0 auto; display: flex; gap: 40px; flex-wrap: wrap; }
.footer__col { flex: 1 1 200px; min-width: 160px; }
.footer__title { font-size: 13px; font-weight: 600; color: #9a9aa8; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 12px; }
.footer__link { display: block; font-size: 14px; color: var(--text-muted); padding: 5px 0; }
.footer__link:hover { color: var(--accent); }
.footer__legal { font-size: 13px; color: var(--text-faint); line-height: 1.55; }
.footer__bottom {
    max-width: var(--max-w); margin: 28px auto 0; padding-top: 20px;
    border-top: 1px solid var(--hairline);
    font-size: 13px; color: var(--text-faint);
    display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap;
}

/* ---------- Уведомления и меню ---------- */

.dropdown { position: relative; }
.dropdown__menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
    min-width: 240px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-xl);
    box-shadow: var(--shadow-md); padding: 6px;
}
.dropdown__menu[hidden] { display: none; }
.dropdown__item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-radius: var(--r-md);
    font-size: 14.5px; color: var(--text-2); cursor: pointer;
    background: none; border: 0; width: 100%; text-align: left;
}
.dropdown__item:hover { background: var(--surface-2); color: var(--text-2); }
.dropdown__divider { height: 1px; background: var(--hairline); margin: 6px 4px; }
.dropdown__user { padding: 10px 12px 4px; }
.dropdown__user-name { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.dropdown__user-handle { display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.dropdown__value { font-family: var(--mono); font-size: 13.5px; color: var(--accent-text); }

.notif-item { display: block; padding: 12px; border-radius: var(--r-md); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.is-unread { background: var(--accent-soft); }
.notif-item__title { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-item__text { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.notif-item__time { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ---------- Пагинация ---------- */

.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px 0 0; flex-wrap: wrap; }
.pagination__link {
    min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--r-md);
    background: var(--surface); color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 500;
}
.pagination__link:hover { border-color: var(--border-hover); color: var(--text-2); }
.pagination__link.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination__gap { color: var(--text-faint); padding: 0 4px; }

/* ---------- Мобильная адаптация ---------- */

@media (max-width: 1100px) {
    .feed__aside, .article__aside { max-width: none; flex-basis: 100%; position: static; }
}

@media (max-width: 900px) {
    .burger {
        display: inline-flex; align-items: center; justify-content: center;
        width: 38px; height: 38px; flex: none;
        border: 0; border-radius: var(--r-md); background: var(--surface-2);
        color: var(--text-3); cursor: pointer;
    }

    .header { padding: 0 14px; gap: 12px; }
    .header__search { display: none; }
    .header__search.is-open {
        display: flex; position: absolute; left: 14px; right: 14px; top: 12px;
        z-index: 45; background: var(--surface-2);
    }
    .header__cta-text { display: none; }

    /* Шапка не должна выталкивать кнопки за экран */
    .header__actions { gap: 8px; min-width: 0; }
    .header__actions .btn { padding: 0 12px; font-size: 13.5px; }
    .header__logo img { height: 24px; }

    /* Вкладки прокручиваются вбок, а не переносятся в несколько рядов */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 8px 10px;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { flex: none; padding: 0 14px; }
    .tabs .badge { flex: none; }

    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
        width: 280px; background: var(--surface);
        padding: 16px 12px 40px; max-height: none;
        transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: var(--shadow-lg); overflow-y: auto;
    }
    .sidebar.is-open { transform: translateX(0); }

    .drawer-backdrop {
        position: fixed; inset: 0; z-index: 55;
        background: rgba(28, 28, 34, .4);
    }
    .drawer-backdrop[hidden] { display: none; }

    .main { padding: 16px 14px 48px; }
    .article { padding: 24px 20px 28px; }
    .comments { padding: 22px 20px 26px; }
    .article__title { font-size: 30px; }
    .prose { font-size: 16.5px; }
    .prose h2 { font-size: 22px; }
    .editor-main { padding: 20px 18px 24px; }
    .editor-aside { max-width: none; }
    .page-title { font-size: 25px; }
    .hero__title { font-size: 23px; }
    .wallet-hero__amount { font-size: 32px; }
}

@media (max-width: 640px) {
    /* На узком экране гость видит только «Войти»: регистрация доступна с этой же страницы */
    .header__actions .btn--ghost { display: none; }

    .post-card { padding: 18px 16px; }
    .post-card__thumb { display: none; }
    .card { padding: 18px 16px; }
    .stat__value { font-size: 24px; }
    .data-table__head { display: none; }
    .data-table__row { grid-template-columns: 1fr !important; gap: 2px; padding: 12px 0; }
    .data-table__row > div { padding: 2px 0; }
    .modal { padding: 22px 18px; }
    .footer { padding: 28px 16px 32px; }
}

@media print {
    .header, .sidebar, .footer, .article__actions, .comments, .article__aside { display: none !important; }
    .article { padding: 0; }
}
