/* =====================================================================
   Главная страница (pages/main.twig).

   Разделы:
     1. Первый экран (тёмный блок под шапкой)
     2. Поиск
     3. Быстрая проверка в Telegram
     4. Блоки под первым экраном
     5. График публикаций по дням
     6. Когда и какая реклама (две карточки)
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. Первый экран
   Тёмный фон продолжает шапку — как в макете.
   --------------------------------------------------------------------- */

.hero {
    background: var(--hero);
    color: #FFFFFF;
}

/* Новогодний сезон: сугроб внизу (css/festive.css), место под него */
.hero.is-festive {
    position: relative;
    overflow: hidden;
}

.hero.is-festive .hero__inner {
    position: relative;

    padding-bottom: 60px;
}

/* Кнопка «🎄 Итоги года» над заголовком */
.hero__year {
    align-self: flex-start;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 14px;
    border: 1px solid rgba(255, 224, 138, .35);
    border-radius: 999px;

    background: linear-gradient(135deg, rgba(255, 224, 138, .18), rgba(255, 159, 67, .14));
    color: #FFE08A;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;

    transition: background .15s ease, transform .1s ease;
}

.hero__year:hover {
    background: linear-gradient(135deg, rgba(255, 224, 138, .28), rgba(255, 159, 67, .22));
}

.hero__year:active {
    transform: translateY(1px);
}

.hero__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 32px;

    padding-top: 32px;
    padding-bottom: 40px;
}

/* Левая колонка */
.hero__main {
    flex: 1 1 520px;

    display: flex;
    flex-direction: column;
    gap: 18px;

    min-width: 0;
}

/* Правая колонка — 4 цифры, сетка 2 × 2 */
.hero__stats {
    flex: 1 1 420px;

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

/* Карточка с цифрой */
.pulse-card {
    padding: 16px;

    border: 1px solid var(--hero-line);
    border-radius: 14px;
    background: var(--hero-card);
}

.pulse-card__label {
    color: #A9B4C8;
    font-size: 13px;
}

.pulse-card__value {
    margin-top: 2px;

    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pulse-card__note {
    margin-top: 2px;

    color: #A9B4C8;
    font-size: 12px;
}

/* Рост — зелёный, падение — красный */
.pulse-card__note.is-up {
    color: #7EE2A8;
}

.pulse-card__note.is-down {
    color: #FCA5A5;
}

.hero__title {
    font-size: 44px;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.hero__text {
    max-width: 600px;

    color: #C3CCDD;
    font-size: 17px;
    line-height: 1.55;
}


/* ---------------------------------------------------------------------
   2. Поиск
   --------------------------------------------------------------------- */

.hero-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    max-width: 620px;
}

/* Поле + выпадающий список под ним */
.hero-search__box {
    position: relative;

    flex: 1 1 300px;

    min-width: 0;
}

/* Белое поле с иконкой лупы */
.hero-search__field {

    height: 54px;
    padding: 0 16px;

    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 0;

    border: 1px solid var(--search-line);
    border-radius: 14px;
    background: var(--search-bg);   /* в тёмной теме — тёмное, в светлой — белое */

    color: var(--search-muted);
}

/* Подсветка поля, когда в нём курсор */
.hero-search__field:focus-within {
    box-shadow: 0 0 0 3px rgba(61, 111, 245, 0.45);
}

.hero-search__field input {
    flex: 1;

    min-width: 0;

    border: 0;
    outline: none;
    background: transparent;

    color: var(--search-fg);
    font-size: 16px;
}

.hero-search__field input::placeholder {
    color: var(--search-muted);
}

.hero-search__button {
    height: 54px;
    padding: 0 24px;

    border-radius: 14px;

    font-size: 16px;
}

/* Лупа в кнопке видна только на телефоне */
.hero-search__button-icon {
    display: none;
}


/* ---------------------------------------------------------------------
   2а. Подсказки поиска (выпадающий список) — по макету
   --------------------------------------------------------------------- */

.suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;

    padding: 8px;

    display: flex;
    flex-direction: column;

    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 18px 48px rgba(6, 10, 18, 0.28);

    color: var(--ink);
}

/* «Популярные боты» … «Живые · MAU» */
.suggest__head {
    padding: 6px 10px 8px;

    display: flex;
    justify-content: space-between;

    color: var(--muted-2);
    font-size: 12px;
    font-weight: 600;
}

.suggest__item {
    padding: 8px 10px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-radius: 10px;
}

/* Выбранный стрелками или под мышью */
.suggest__item.is-active {
    background: var(--soft);
}

.suggest__avatar {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;
    overflow: hidden;

    border-radius: 10px;

    color: #FFFFFF;
    font-weight: 700;
}

.suggest__avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.suggest__name {
    flex: 1;

    display: flex;
    flex-direction: column;

    min-width: 0;
}

.suggest__name b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-weight: 600;
}

.suggest__name span,
.suggest__nums span {
    color: var(--muted-2);
    font-size: 12px;
}

.suggest__nums {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.suggest__nums b {
    font-size: 13px;
}

.suggest__empty {
    padding: 14px 10px;

    color: var(--muted);
}

/* «Войдите, чтобы искать дальше» */
.suggest__auth {
    padding: 14px 10px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.suggest__auth span {
    color: var(--muted);
    font-size: 14px;
}

.suggest__auth .btn {
    margin-top: 6px;
}

/* «Показать все результаты в каталоге →» */
.suggest__all {
    margin-top: 4px;
    padding: 10px;

    display: flex;
    justify-content: space-between;
    gap: 10px;

    border-top: 1px solid var(--line);

    color: var(--accent-ink);
    font-weight: 600;
}

.suggest__all:hover {
    background: var(--soft);
}


/* ---------------------------------------------------------------------
   3. Быстрая проверка в Telegram
   --------------------------------------------------------------------- */

.hero-tg {
    align-self: flex-start;

    /* В макете между поиском и этим блоком отступ больше обычного */
    margin-top: 14px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 14px 10px 10px;

    border: 1px solid var(--hero-line);
    border-radius: 14px;
    background: var(--hero-card);

    color: #FFFFFF;

    transition: border-color 0.15s ease;
}

.hero-tg:hover {
    border-color: #3A4A6B;
}

/* Голубой круг с самолётиком Telegram */
.hero-tg__icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    border-radius: 50%;
    background: var(--tg-bg);
}

.hero-tg__text {
    display: flex;
    flex-direction: column;
}

.hero-tg__text span {
    color: #A9B4C8;
    font-size: 13px;
}

.hero-tg__button {
    margin-left: 8px;
    padding: 7px 12px;

    border-radius: 9px;
    /* Темнее общего голубого Telegram: белый текст на #229ED9 – контраст 3,0, нужно от 4,5 (здесь 4,9) */
    background: #1377AD;

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}


/* ---------------------------------------------------------------------
   4. Блоки под первым экраном — столбиком с отступом 20px (как в макете)
   --------------------------------------------------------------------- */

.main-blocks {
    padding-top: 24px;
    padding-bottom: 56px;

    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* ---------------------------------------------------------------------
   5. График публикаций по дням
   --------------------------------------------------------------------- */

.ads-chart {
    padding: 24px;
}

/* Заголовок слева, цифры и переключатель справа */
.ads-chart__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.ads-chart__title {
    /* Заголовок сжимается (подпись уходит на 2-ю строку),
       чтобы цифры и переключатель 30/90 оставались справа в той же строке */
    flex: 1 1 320px;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ads-chart__stats {
    flex: 0 1 auto;   /* на широком — в строку с заголовком, на узком — переносятся внутри */
    min-width: 0;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.ads-chart__stat-label {
    color: var(--muted-2);
    font-size: 12px;
}

.ads-chart__stat-value {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ads-chart__stat-value.is-up {
    color: var(--up);
}

.ads-chart__stat-value.is-down {
    color: var(--down);
}

/* Переключатель «30 дней / 90 дней» */
.period-switch {
    display: flex;
    padding: 4px;

    border-radius: 10px;
    background: var(--chip);
}

.period-switch button {
    min-height: 36px;
    padding: 8px 14px;

    border: 0;
    border-radius: 8px;
    background: transparent;

    color: var(--muted);
    font-weight: 600;

    cursor: pointer;
}

.period-switch button[aria-pressed="true"] {
    background: var(--card);
    color: var(--ink);
}

/* Область графика: сетка, столбики и линия лежат друг на друге.
   Линии сетки – под столбиками, подписи шкалы – поверх (на фоне карточки) */
.ads-chart__area {
    --y-gut: 0px;

    position: relative;

    height: 260px;
    margin-top: 20px;
}

.ads-chart__grid {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    pointer-events: none;
}

.ads-chart__grid div {
    position: relative;

    border-top: 1px dashed var(--line);

    color: var(--muted-2);
    font-size: 11px;
}

/* Линия сетки начинается после полосы подписей */
.ads-chart__grid div {
    margin-left: var(--y-gut);
}

/* Подпись шкалы – плашка на своей линии внутри графика, поверх столбиков:
   у сетки нет z-index, поэтому плашка с z-index встаёт над столбиками, а линии остаются под ними */
.ads-chart__grid span {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;

    padding: 0 6px 1px 0;
    border-radius: 0 6px 6px 0;

    background: var(--card);
    line-height: 1.4;
    white-space: nowrap;

    transform: translateY(-50%);
}

/* Нижняя линия — сплошная */
.ads-chart__grid div:last-child {
    border-top-style: solid;
}

/* Столбики и линия – правее полосы подписей */
.ads-chart__bars {
    position: absolute;
    inset: 0 0 0 var(--y-gut);

    display: flex;
    align-items: stretch;
}

.ads-chart__col {
    position: relative;

    flex: 1 1 0;

    min-width: 0;
    display: flex;
}

.ads-chart__bar-btn {
    flex: 1;

    min-width: 0;
    padding: 0;

    display: flex;
    align-items: flex-end;

    border: 0;
    background: transparent;

    cursor: pointer;
}

.ads-chart__bar {
    display: block;

    width: 100%;

    border-radius: 3px 3px 0 0;
    background: var(--bar-soft);
}

.ads-chart__bar.is-today {
    background: var(--chip);
}

.ads-chart__bar.is-on {
    background: var(--bar-on);
}

/* Линия среднего поверх столбиков, мышь проходит сквозь неё */
.ads-chart__line {
    position: absolute;
    inset: 0 0 0 var(--y-gut);

    width: calc(100% - var(--y-gut));
    height: 100%;

    pointer-events: none;
}

.ads-chart__line path {
    stroke: var(--line-color);
}

/* Подсказка над столбиком */
.ads-chart__tip {
    position: absolute;
    top: 4px;
    z-index: 3;

    padding: 9px 12px;

    border-radius: 10px;
    border: 1px solid var(--tip-line);
    background: var(--tip-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);

    color: var(--tip-fg);
    font-size: 13px;
    white-space: nowrap;

    pointer-events: none;
}

.ads-chart__tip.is-center {
    left: 50%;
    transform: translateX(-50%);
}

.ads-chart__tip.is-left {
    left: 0;
}

.ads-chart__tip.is-right {
    right: 0;
}

.ads-chart__tip-avg {
    opacity: 0.75;
}

.ads-chart__labels {
    margin-top: 8px;

    display: flex;
    justify-content: space-between;

    color: var(--muted-2);
    font-size: 12px;
}

.ads-chart__legend {
    margin-top: 10px;

    display: flex;
    flex-wrap: wrap;
    gap: 16px;

    color: var(--muted);
    font-size: 12px;
}

.ads-chart__legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ads-chart__legend-bar {
    display: inline-block;

    width: 12px;
    height: 12px;

    border-radius: 3px;
    background: var(--bar-soft);
}

.ads-chart__legend-line {
    display: inline-block;

    width: 16px;
    height: 3px;

    border-radius: 2px;
    background: var(--line-color);
}


/* ---------------------------------------------------------------------
   6. Когда и какая реклама — две карточки в ряд (по макету)
   --------------------------------------------------------------------- */

.profile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.profile-card {
    flex: 1 1 440px;

    min-width: 0;
    padding: 22px;

    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-card__title {
    font-size: 18px;
}

.profile-card__sub {
    font-size: 13px;
}

/* Подзаголовок внутри карточки: «По часам», «Формат поста» */
.profile-card__label {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

.profile-card__note {
    padding: 10px 12px;

    border-radius: 10px;
    background: var(--soft);

    color: var(--ink-2);
    font-size: 13px;
}


/* Подсказка над элементом (общая для блоков с наведением) */
.chart-tip {
    position: absolute;
    z-index: 3;

    padding: 8px 12px;

    border-radius: 10px;
    border: 1px solid var(--tip-line);
    background: var(--tip-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);

    color: var(--tip-fg);
    font-size: 13px;
    white-space: nowrap;

    pointer-events: none;
}

/* Над элементом, по центру */
.chart-tip--above {
    top: -6px;
    left: 50%;
    transform: translate(-50%, -100%);
}

/* У левого / правого края — прижимается к краю */
.chart-tip--left {
    left: 0;
    transform: translateY(-100%);
}

.chart-tip--right {
    left: auto;
    right: 0;
    transform: translateY(-100%);
}

.chart-tip__muted {
    opacity: 0.75;
}


/* Столбики по дням недели. Высота столбика — в пикселях (до 100px),
   задаётся в шаблоне; ещё ~24px — подпись дня */
.dow-bars {
    height: 140px;

    display: flex;
    align-items: stretch;
    gap: 8px;
}

.dow-bars__item {
    position: relative;

    flex: 1;

    display: flex;
}

.dow-bars__btn {
    flex: 1;

    padding: 0;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* без этого браузер не растягивает столбик внутри кнопки по ширине */
    align-items: stretch;
    gap: 6px;

    border: 0;
    background: transparent;

    color: var(--ink-2);

    cursor: pointer;
}

.dow-bars__bar {
    display: block;

    border-radius: 6px 6px 2px 2px;
    background: var(--bar-soft);
}

.dow-bars__bar.is-top {
    background: var(--accent);
}

.dow-bars__bar.is-on {
    background: var(--bar-on);
}

.dow-bars__name {
    font-size: 12px;
    text-align: center;
}


/* Тепловая карта по часам */
.hours {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hours__grid {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 3px;
}

.hours__item {
    position: relative;

    display: flex;
}

.hours__cell {
    flex: 1;

    height: 30px;
    padding: 0;

    border: 0;
    border-radius: 4px;

    /* --level: от 0.15 (тише всего) до 1 (пик) — задаётся в шаблоне */
    background: rgba(var(--heat-rgb), var(--level));

    cursor: pointer;
}

.hours__cell.is-on {
    box-shadow: 0 0 0 2px var(--ink);
}

.hours__labels {
    display: flex;
    justify-content: space-between;

    color: var(--muted-2);
    font-size: 11px;
}


/* Формат поста: полоса из долей */
.formats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.formats__bar {
    height: 18px;

    display: flex;
    gap: 2px;
}

.formats__part {
    position: relative;

    min-width: 6px;

    display: flex;
}

.formats__seg {
    flex: 1;

    padding: 0;

    border: 0;
    border-radius: 4px;

    cursor: pointer;
}

.formats__seg.is-on {
    box-shadow: 0 0 0 2px var(--ink);
}

/* Цвета форматов — как в макете */
.formats__seg--photo { background: #2457E6; }
.formats__seg--text  { background: #8EA9F2; }
.formats__seg--video { background: #E08A3C; }
.formats__seg--other { background: #94A0B6; }

.formats__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;

    font-size: 13px;
}

.formats__legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.formats__dot {
    display: inline-block;

    width: 10px;
    height: 10px;

    border-radius: 3px;
}


/* Куда ведёт реклама: строки с полосками */
.dest {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dest__item {
    position: relative;
}

.dest__row {
    width: 100%;
    padding: 6px 8px;

    display: flex;
    align-items: center;
    gap: 12px;

    border: 0;
    border-radius: 8px;
    background: transparent;

    color: var(--ink);
    font-size: 14px;

    cursor: pointer;
}

.dest__row.is-on {
    background: var(--soft);
}

.dest__name {
    width: 92px;

    text-align: left;
}

.dest__track {
    flex: 1;

    display: block;
    height: 10px;

    border-radius: 5px;
    background: var(--chip);
}

.dest__fill {
    display: block;
    height: 10px;

    border-radius: 5px;
}

.dest__fill--web,
.dest__fill--bot     { background: #2457E6; }
.dest__fill--channel { background: #E08A3C; }
.dest__fill--mixed   { background: #94A0B6; }

.dest__pct {
    width: 44px;

    text-align: right;
}


/* ---------------------------------------------------------------------
   Телефон
   --------------------------------------------------------------------- */

@media (max-width: 720px) {
    .hero__title {
        font-size: 32px;
    }

    .hero__text {
        font-size: 15px;
    }

    /* На узком экране кнопка «Найти» — только иконка */
    .hero-search__button {
        padding: 0 18px;
    }

    .hero-search__button-icon {
        display: inline-flex;
    }

    .hero-search__button-text {
        display: none;
    }

    .hero-search__box {
        flex-basis: 0;
    }

    .hero-tg {
        align-self: stretch;
    }
}


/* =================================================================
   Топы: новые боты, прирост, упоминания
   ================================================================= */

/*
   Топы: на широком экране (от 1100px) — три в ряд.
   Уже — каждый на всю ширину, друг под другом
   (не «два в ряд и третий отдельно»).
*/
.tops {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 1100px) {
    .tops {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.top-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px 8px 10px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.top-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;

    padding: 0 12px 10px;
}

.top-card__title {
    margin: 0;

    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
}

.top-card__sub {
    display: block;

    color: var(--muted);
    font-size: 13px;
}

.top-card__all {
    color: var(--accent-ink);
    font-weight: 600;
    white-space: nowrap;
}

.top-card__all:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Вкладки на всю ширину карточки (основа — .period-switch) */
.top-card__tabs {
    margin: 0 12px 8px;
}

.top-card__tabs button {
    flex: 1;
    padding: 8px 6px;

    font-size: 14px;
    white-space: nowrap;   /* «Падение MAU» — в одну строку, как в макете */
}

.top-card__tabs button[aria-selected="true"] {
    background: var(--card);
    color: var(--ink);
}

/* Список */
.top-list {
    margin: 0;
    padding: 0;

    list-style: none;
}

.top-list__empty {
    padding: 16px 12px;

    color: var(--muted);
    font-size: 14px;
}

/* Строка топа */
.top-row {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 12px;

    border-radius: 10px;
    color: var(--ink);

    transition: background .15s ease;
}

.top-row:hover {
    background: var(--soft);
}

.top-row__rank {
    width: 18px;
    flex: 0 0 auto;

    color: var(--muted-2);
    font-size: 13px;
    text-align: right;
}

.top-row__avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    border-radius: 10px;
    color: #FFFFFF;
    font-weight: 700;
}

.top-row__avatar img {
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;
}

.top-row__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.top-row__name,
.top-row__user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-row__name {
    font-weight: 600;
}

.top-row__user {
    color: var(--muted-2);
    font-size: 12px;
}

.top-row__nums {
    /* Число справа не сжимается: ужимается имя (с многоточием) */
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.top-row__value {
    font-weight: 700;
    white-space: nowrap;
}

.top-row__extra {
    color: var(--muted-2);
    font-size: 11px;
    white-space: nowrap;
}

/* Цвет главной цифры по типу топа */
.top-list--live .top-row__value,
.top-list--mau .top-row__value {
    color: var(--up);
}

.top-list--drop .top-row__value {
    color: var(--down);
}

.top-list--mentions .top-row__value {
    color: var(--warm);
}

/* Рекламный слот */
.top-row__avatar--plus {
    background: var(--soft);
    color: var(--muted-2);
    font-weight: 400;
}

.top-row__ad-name {
    color: var(--ink-2);
    font-weight: 500;
}

.top-row__ad-sub {
    color: var(--muted-2);
    font-size: 11px;
}

.top-row__ad-label {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Оплаченный закреп в топе (pages/main.twig, ad_slot): строка выделена цветом, текст – в одну строку */
.top-row--ad.is-paid {
    border-radius: 10px;
    background: var(--accent-soft);
}

.top-row--ad.is-paid .top-row__avatar {
    overflow: hidden;
    background: var(--card);
    color: var(--ink-2);
    font-weight: 600;
}

.top-row--ad.is-paid .top-row__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-row--ad.is-paid .top-row__ad-name {
    color: var(--ink);
    font-weight: 600;
}

.top-row--ad.is-paid .top-row__ad-name,
.top-row--ad.is-paid .top-row__ad-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Цвета аватарок без картинки (.avatar-color-*) — в base.css */


/* =================================================================
   Популярные рекламодатели за неделю
   ================================================================= */

.adv {
    display: flex;
    flex-direction: column;
    padding: 22px 10px 12px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.adv__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;

    padding: 0 12px 12px;
}

.adv__title {
    margin: 0;

    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.adv__sub {
    display: block;

    color: var(--muted);
    font-size: 13px;
}

.adv__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;

    width: 100%;
}

.adv__tabs {
    flex: 0 0 auto;
}

.adv__tabs button {
    font-size: 14px;
}

.adv__tabs button[aria-selected="true"] {
    background: var(--card);
    color: var(--ink);
}

.adv__note {
    flex: 1 1 260px;
    min-width: 0;
    min-height: 20px;

    color: var(--ink-2);
    font-size: 13px;
}

/*
   Список, строки — как в топах (.top-row).
   Широкий экран — 3 колонки × 3 строки = 9; уже — 2 колонки или 1,
   там девятого не показываем: 8 = ровно 4 строки по 2.
*/
.adv__list {
    display: grid;
    /* minmax(0, …): длинное имя не раздвигает колонку шире экрана (на телефоне страница уезжала вбок) */
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 16px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.adv__row {
    gap: 12px;
    padding: 9px 12px;
}

.adv__list > li:nth-child(9) {
    display: none;
}

@media (min-width: 700px) {
    .adv__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1040px) {
    .adv__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .adv__list > li:nth-child(9) {
        display: block;
    }
}

/* Строка без ссылки (цель не из каталога) — без подсветки */
div.adv__row:hover {
    background: transparent;
}


/* Нативный рекламный блок (.banner-slot) — в base.css: он есть и на главной, и в каталоге */


/* =================================================================
   Продукты BotStat
   ================================================================= */

.products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.products__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.products__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
}

.products__title {
    margin: 0;

    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.products__sub {
    color: var(--muted);
}

.products__all {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 10px 16px;

    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
    font-weight: 600;
}

.products__all:hover {
    border-color: var(--line-hover);
}

/*
   Четыре карточки: на широком экране — все в ряд;
   если не помещаются — 2 + 2 (а не «3 + 1»); на телефоне — одна колонка.
*/
.products__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 700px) {
    .products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .products__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Карточка продукта; --product — цвет продукта (задаётся в разметке) */
.product-card {
    display: flex;
    flex-direction: column;
    gap: 14px;

    padding: 22px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    color: var(--ink);

    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--line-hover);
}

.product-card__top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-card__icon {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    border-radius: 13px;
    background: var(--product);
    color: #FFFFFF;
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 800;
}

.product-card__icon img {
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;
}

.product-card__names {
    display: flex;
    flex-direction: column;
}

.product-card__name {
    font-family: var(--font-head);
    font-size: 18px;
}

.product-card__tag {
    color: var(--muted);
    font-size: 13px;
}

.product-card__text {
    color: var(--ink-2);
    font-size: 14px;
}

.product-card__points {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.product-card__point {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    color: var(--ink-2);
    font-size: 13px;
}

.product-card__point svg {
    flex: 0 0 auto;
    margin-top: 2px;

    color: var(--product);
}

.product-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-top: auto;
}

/* Длинный @username в узкой карточке — с многоточием, не наезжает на кнопку */
.product-card__handle {
    min-width: 0;
    overflow: hidden;

    color: var(--muted-2);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card__try {
    flex: 0 0 auto;
    padding: 9px 14px;

    white-space: nowrap;

    border-radius: 10px;
    background: var(--product);
    color: #FFFFFF;
    font-weight: 600;
}


/* =================================================================
   BotSafe и Plus (две карточки рядом)
   ================================================================= */

.offers {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* --- BotSafe: всегда тёмная, в любой теме --- */
.botsafe {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    display: flex;
    flex: 1 1 460px;
    flex-direction: column;
    gap: 14px;

    padding: 28px;

    border: 1px solid #1F2A24;
    border-radius: 18px;
    background:
        radial-gradient(120% 90% at 100% 100%, rgba(34, 197, 94, .30) 0%, rgba(34, 197, 94, 0) 55%),
        radial-gradient(70% 60% at 0% 0%, rgba(59, 130, 246, .16) 0%, rgba(59, 130, 246, 0) 60%),
        #0C0F14;
    color: #FFFFFF;
}

/* Сетка-фон, видна в правом нижнем углу */
.botsafe__grid {
    position: absolute;
    inset: 0;
    z-index: -2;

    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 28px 28px;

    -webkit-mask-image: radial-gradient(80% 80% at 100% 100%, #000 0%, transparent 75%);
    mask-image: radial-gradient(80% 80% at 100% 100%, #000 0%, transparent 75%);
}

/* Пример отчёта справа — украшение */
.botsafe__report {
    position: absolute;
    top: 22px;
    right: 18px;
    z-index: -1;

    display: flex;
    flex-direction: column;
    gap: 7px;
    box-sizing: border-box;
    width: 206px;
    padding: 14px;

    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    color: #9CA3AF;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;

    transform: rotate(-4deg);
    pointer-events: none;

    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.botsafe__report-head {
    display: flex;
    align-items: center;
    gap: 8px;

    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.botsafe__report-head b {
    color: #F3F4F6;
    font-size: 12px;
}

.botsafe__check {
    width: 18px;
    height: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 5px;
    background: #22C55E;
    color: #0C0F14;
    font-size: 12px;
    font-weight: 900;
}

.botsafe__report-label {
    margin-top: 4px;

    color: #6EE7A0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.botsafe__meter {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.botsafe__meter-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;

    white-space: nowrap;   /* «М 53% · Ж 47%» — в одну строку */
}

.botsafe__meter-row b {
    color: #E5E7EB;
    font-weight: 600;
}

.botsafe__meter-track {
    display: block;
    height: 4px;

    border-radius: 2px;
    background: rgba(255, 255, 255, .08);
}

.botsafe__meter-track span {
    display: block;
    height: 100%;

    border-radius: 2px;
}

.botsafe__langs {
    display: flex;
    gap: 2px;
    overflow: hidden;
    height: 8px;

    border-radius: 4px;
}

.botsafe__langs-rest {
    flex: 1;

    background: rgba(255, 255, 255, .14);
}

.botsafe__flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.botsafe__ages {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 34px;
}

.botsafe__ages i {
    flex: 1;

    border-radius: 3px 3px 0 0;
    background: rgb(110, 231, 160);
}

.botsafe__ages-legend {
    display: flex;
    justify-content: space-between;

    color: #6B7280;
}

.botsafe__brand {
    display: flex;
    align-items: center;
    gap: 10px;

    color: #D4D4D4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

.botsafe__brand img {
    width: 32px;
    height: 32px;
    display: block;

    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}

/* Текст не заходит под пример отчёта */
.botsafe__text-width {
    max-width: calc(100% - 210px);
}

.botsafe__title {
    margin: 0;

    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.botsafe__text {
    margin: 0;

    color: #C9D2E3;
    font-size: 15px;
    line-height: 1.55;
}

.botsafe__note {
    margin: 0;

    color: #A9B4C8;
    font-size: 13px;
    line-height: 1.5;
}

.botsafe__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 4px;
}

.botsafe__cta,
.botsafe__add {
    padding: 12px 18px;

    border-radius: 10px;
    font-weight: 600;

    transition: filter .15s ease;
}

.botsafe__cta {
    background: var(--safe-cta-bg);     /* светлая тема — белая, тёмная — зелёная */
    color: var(--safe-cta-fg);
}

.botsafe__add {
    display: flex;
    align-items: center;
    gap: 6px;

    border: 1px solid #3A4659;
    color: #FFFFFF;
}

.botsafe__cta:hover,
.botsafe__add:hover {
    filter: brightness(1.1);
}

/* На узком экране пример отчёта прячем — текст на всю ширину */
@media (max-width: 720px) {
    .botsafe__report {
        display: none;
    }

    .botsafe__text-width {
        max-width: none;
    }
}

/* --- Plus --- */
.plus-card {
    display: flex;
    flex: 1 1 460px;
    flex-direction: column;
    gap: 16px;

    padding: 28px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.plus-card__brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.plus-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding: 3px 9px;

    border-radius: 999px;
    background: var(--plus-bg);
    color: var(--plus-fg);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
}

.plus-card__botstat {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

.plus-card__title {
    margin: 0 0 4px;

    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.plus-card__sub {
    color: var(--muted);
    font-size: 14px;
}

.plus-card__groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.plus-card__group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.plus-card__group svg {
    flex: 0 0 auto;
    margin-top: 1px;

    color: var(--plus-icon);
}

.plus-card__group > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.plus-card__group b {
    font-size: 14px;
}

.plus-card__group > span > span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.plus-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;

    margin-top: auto;
    padding-top: 4px;
}

.plus-card__cta {
    padding: 12px 18px;

    border-radius: 10px;
    background: var(--btn-primary-bg);
    color: #FFFFFF;
    font-weight: 600;
}

.plus-card__cta:hover {
    filter: brightness(1.1);
}

.plus-card__price {
    color: var(--muted);
    font-size: 14px;
}

.plus-card__price b {
    color: var(--ink);
}

@media (max-width: 520px) {
    .plus-card__groups {
        grid-template-columns: 1fr;
    }
}


/* =================================================================
   Биржа: боты в продаже
   ================================================================= */

.birzha {
    display: flex;
    flex-direction: column;
    gap: 16px;

    padding: 22px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.birzha__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.birzha__title {
    margin: 0;

    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.birzha__sub {
    color: var(--muted);
}

.birzha__count {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--ink-2);
    font-weight: 600;
}

.birzha__count b {
    color: var(--warm);
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
}

.birzha__count:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.birzha__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.birzha__add,
.birzha__all {
    padding: 10px 14px;

    border-radius: 10px;
    font-weight: 600;
}

.birzha__add {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    border: 1px solid var(--line);
    color: var(--ink);
}

.birzha__add:hover {
    border-color: var(--line-hover);
}

.birzha__all {
    background: var(--btn-strong-bg);   /* светлая тема — тёмная, тёмная — синяя */
    color: var(--btn-strong-fg);
}

.birzha__all:hover {
    filter: brightness(1.1);
}

.birzha__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 12px;
}

.birzha__empty {
    margin: 0;

    color: var(--muted);
}

/* На телефоне — только 3 объявления */
@media (max-width: 720px) {
    .birzha__grid > .sale-card:nth-of-type(n+4) {
        display: none;
    }
}

/* Карточка объявления */
.sale-card {
    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 12px 14px;

    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);

    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.sale-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--line-hover);
}

.sale-card__top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sale-card__avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    border-radius: 50%;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
}

.sale-card__avatar img {
    width: 100%;
    height: 100%;
    display: block;

    object-fit: cover;
}

.sale-card__names {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sale-card__name,
.sale-card__user {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-card__name {
    font-size: 14px;
}

.sale-card__user {
    font-size: 12px;
}

.sale-card__user > span:first-child {
    color: var(--accent-ink);
    font-weight: 600;
}

.sale-card__cat {
    color: var(--muted-2);
}

.sale-card__price {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.sale-card__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 16px;

    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.sale-card__stats > span {
    white-space: nowrap;
}

.sale-card__stats b {
    color: var(--ink);
    font-size: 15px;
}

.sale-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;

    padding-top: 9px;

    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Пол: М 54% ▬▬▬ Ж 46% */
.sale-card__sex {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sale-card__m {
    color: var(--sex-m);
}

.sale-card__f {
    color: var(--sex-f);
}

.sale-card__bar {
    display: flex;
    gap: 2px;
    overflow: hidden;
    width: 44px;
    height: 5px;

    border-radius: 999px;
}

.sale-card__bar i {
    display: block;
}

.sale-card__bar-m {
    background: var(--sex-m);
}

.sale-card__bar-f {
    flex: 1;

    background: var(--sex-f);
}

.sale-card__premium {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding-left: 12px;

    border-left: 1px solid var(--line);
}

.sale-card__premium svg {
    color: var(--premium);
}

.sale-card__premium b {
    color: var(--ink-2);
}

.sale-card__date {
    margin-left: auto;

    color: var(--muted-2);
}


/* =================================================================
   Последние отзывы и чаты комьюнити (две карточки рядом)
   ================================================================= */

/* Отзывы и чаты в одном ряду — одной высоты */
.community {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 16px;
}

/* --- Отзывы --- */
.reviews {
    display: flex;
    flex: 999 1 640px;
    flex-direction: column;
    gap: 14px;
    min-width: 0;

    padding: 22px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.reviews__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reviews__title,
.chats__title {
    margin: 0;

    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.reviews__all {
    color: var(--accent-ink);
    font-weight: 600;
}

.reviews__all:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/*
   Сетка отзывов занимает всю высоту карточки (flex: 1). Лишнее место
   делится между строками (align-content: stretch) — внизу нет пустоты,
   когда соседние «Чаты» выше. Раскрытый длинный отзыв растягивает только
   свою строку. Карточки в ряду одной высоты, «Читать полностью» — внизу.
*/
.reviews__grid {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    align-content: stretch;
    align-items: stretch;
    gap: 12px;
}

.reviews__empty {
    margin: 0;

    color: var(--muted);
}

/* На телефоне — 3 отзыва */
@media (max-width: 720px) {
    .reviews__grid > .review:nth-of-type(n+4) {
        display: none;
    }
}

.review {
    display: flex;
    flex-direction: column;
    gap: 10px;

    margin: 0;
    padding: 16px;

    border-radius: 14px;
    background: var(--soft);
}

/*
   Тональность: едва заметная подложка + большая бледная иконка
   «палец вверх / вниз» в правом нижнем углу (украшение, текст поверх).
*/
.review--pos,
.review--neg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.review--pos {
    background: var(--review-pos);
}

.review--neg {
    background: var(--review-neg);
}

.review--pos::after,
.review--neg::after {
    content: "";

    position: absolute;
    right: -8px;
    bottom: -10px;
    z-index: -1;

    width: 84px;
    height: 84px;

    opacity: .09;
    pointer-events: none;

    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}

.review--pos::after {
    background: var(--up);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v12'/%3E%3Cpath d='M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10v12'/%3E%3Cpath d='M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z'/%3E%3C/svg%3E");
}

.review--neg::after {
    background: var(--down);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 14V2'/%3E%3Cpath d='M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 14V2'/%3E%3Cpath d='M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z'/%3E%3C/svg%3E");
    transform: rotate(-8deg);
}

.review__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review__avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    color: #FFFFFF;
    font-weight: 700;
}

.review__who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.review__who > span {
    color: var(--muted-2);
    font-size: 12px;
}

/* Текст отзыва: переносы строк как у автора */
.review__text {
    margin: 0;

    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Ссылки в тексте отзыва (@бот, @человек, сайты) */
/* Ссылка внутри текста отзыва – не только цветом, но и тонким подчёркиванием (доступность) */
.review__link {
    color: var(--accent-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 2px;
}

.review__link:hover {
    text-decoration-color: currentColor;
}

/* Длинный отзыв — свёрнут до 4 строк */
.review__text.is-clamped {
    display: -webkit-box;
    overflow: hidden;

    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.review__toggle {
    align-self: flex-start;
    margin-top: auto;   /* прижата к низу карточки */

    padding: 6px 0;

    border: 0;
    background: transparent;
    color: var(--accent-ink);
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

.review__toggle:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Чаты комьюнити --- */
/*
   Чаты — по своему содержимому (flex-start): когда раскрыт длинный отзыв,
   карточка чатов не тянется за ним. А отзывы под чаты тянутся (.community stretch).
*/
.chats {
    align-self: flex-start;

    display: flex;
    flex: 1 1 344px;   /* ширина как в макете: «Официальный» помещается рядом с названием */
    flex-direction: column;
    gap: 14px;

    padding: 22px;

    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.chat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 16px;

    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);

    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.chat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--line-hover);
}

.chat-card__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.chat-card__img {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: block;

    border-radius: 50%;
    object-fit: cover;
}

.chat-card__badge {
    padding: 2px 7px;

    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 11px;
    font-weight: 600;
}

.chat-card__desc {
    color: var(--ink-2);
    font-size: 13px;
}

.chat-card__cta {
    align-self: flex-start;

    padding: 9px 14px;

    border-radius: 10px;
    background: var(--btn-primary-bg);
    color: #FFFFFF;
    font-weight: 600;
}
