/**
 * GunCult - Profile Widgets
 * shadcn-inspired cards with border + shadow-sm
 */

@import url('progress.css');

/* ─── Базовый виджет ─────────────────────────────────────────────────────── */

.profile-widget {
    background: var(--bg-content-main);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-mdl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-mdl);
    isolation: isolate;
}

/* На адаптиве — виджеты у края экрана без боковых линий (как .catalog-main .gc-panel) */
@media (max-width: 991.98px) {
    .catalog-main .profile-widget {
        /* border-left: none;
        border-right: none; */
    }
}

/* Контейнер стека виджетов — управляет отступами между виджетами */
.profile-widgets-stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Карточка профиля, коллауты и стек виджетов — тот же шаг, что между виджетами */
.catalog-main:has(.profile-widgets-stack) {
    gap: var(--spacing-md);
}

/* Доп. воздух перед лентой мероприятий (gap стека не трогаем) */
/* (intentionally no extra spacing — handled by stack gap) */

/* Лента на главной профиля: порядок и отступы как на /profile/events */
.profile-events-feed-page-mirror {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0;
}

/* @deprecated — используй .profile-widgets-stack с gap */
.profile-widget-mb {
    margin-bottom: var(--spacing-sm);
}

/* SVG-плейсхолдеры: экспорт как тёмные линии; в тёмной теме — инверсия в светлые (см. utilities .svg-theme-adaptive) */
.gc-empty-illustration-strong {
    opacity: 1;
}

/* Обложка профиля без фото — полноцветный SVG: .svg-theme-native в utilities.css */
/* Линейные SVG в stacked / hero: в светлой теме без invert; в тёмной — invert + смягчение */
.gc-empty-state--stacked .gc-empty-state-image.gc-empty-illustration-strong.svg-theme-adaptive,
.gc-panel > .gc-panel-header-hero .gc-empty-state-image.gc-empty-illustration-strong.svg-theme-adaptive {
    --svg-theme-adaptive-filter: none;
}

[data-theme="dark"] .gc-empty-state--stacked .gc-empty-state-image.gc-empty-illustration-strong.svg-theme-adaptive,
[data-theme="dark"] .gc-panel > .gc-panel-header-hero .gc-empty-state-image.gc-empty-illustration-strong.svg-theme-adaptive {
    --svg-theme-adaptive-filter: invert(1) opacity(var(--svg-theme-adaptive-opacity-dark));
}


/* ─── Grid статистики ────────────────────────────────────────────────────── */

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-mdl);
    align-items: stretch;
}

@media (min-width: 768px) {
    .profile-stats-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    }
}

.profile-stats-grid > .profile-widget {
    height: 100%;
    min-height: 0;
}

/* ─── Заголовок виджета ──────────────────────────────────────────────────── */

.profile-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-widget-description {
    margin: var(--spacing-4xs) 0 0;
    font-size: var(--font-size-sm);
    color: var(--font-secondary);
}

.profile-widget-title-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.profile-widget-form {
    margin: 0;
}

/* ─── Контент виджета ────────────────────────────────────────────────────── */

.profile-widget-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* ─── Стат-виджеты: Топ-3 + Попадания (макет Figma — сетка 1:3) ───────────── */

.profile-widget-stat {
    box-sizing: border-box;
}

.profile-widget-stat .profile-widget-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--spacing-sm);
    min-height: var(--spacing-lg);
}

.profile-widget-stat-aside {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

/* ─── Stat Card (shadcn dashboard pattern) ───────────────────────────────── */

.gc-stat-card {
    background: var(--bg-content-main);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.gc-stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gc-stat-card-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--font-secondary);
    margin: 0;
}

.gc-stat-card-icon {
    color: var(--font-secondary);
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.gc-stat-card-value {
    margin: 0;
}

.gc-stat-card-sub {
    font-size: var(--font-size-xs);
    color: var(--font-secondary);
    margin: 0;
}

.gc-stat-card-accent .gc-stat-card-value {
    color: var(--accent-link);
}

/* ─── Progress bar (Топ-3, Попадания, др.) ─────────────────────────────── */

.profile-progress {
    display: flex;
    gap: var(--spacing-2xs);
    height: 20px;
    background-color: var(--bg-content-secondary);
    border-radius: var(--radius-full);
    padding: var(--spacing-xs);
}

/* Kit gc-progress на том же узле: не применять «толстую» подписочную дорожку */
.profile-progress.gc-progress--segmented,
.profile-progress.gc-progress--dots {
    height: var(--gc-progress-track-height);
    min-height: var(--gc-progress-track-height);
    padding: 0;
    background-color: transparent;
    gap: var(--gc-progress-segment-gap);
    align-items: stretch;
    box-sizing: border-box;
}

.profile-progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow) var(--ease-out);
}

.profile-progress-bar--primary {
    background-color: var(--font-primary);
}

.profile-progress-bar-accent {
    background-color: var(--accent-link);
}

/* ─── Stat text ──────────────────────────────────────────────────────────── */

.profile-stat-text {
    color: var(--font-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.25;
    margin: 0;
}

/* ─── Update button ──────────────────────────────────────────────────────── */

.profile-update-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-link);
    cursor: pointer;
    font-size: var(--font-size-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.profile-update-btn:hover {
    color: var(--accent-link-hover);
}

.profile-update-btn i {
    font-size: var(--font-size-sm);
}

/* ─── Топ-3: макет Figma — пика + «N раз», кнопка обновления в шапке ─────── */

.profile-widget-top3 {
    height: 100%;
}

.profile-widget-top3 .profile-widget-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.profile-top3-body {
    margin-top: auto;
}

.profile-top3-figure {
    display: flex;
    align-items: center;
    gap: var(--spacing-3xs);
    min-width: 0;
}

.profile-top3-spade-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-top3-spade-icon {
    font-size: var(--font-size-xl);
    line-height: 1;
    color: var(--font-primary);
}

.profile-top3-times {
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.25;
    color: var(--font-secondary);
}

.profile-top3-empty {
    margin-top: auto;
}

/* ─── Попадания: сетка зон (макет Figma) ─────────────────────────────────── */

.profile-hit-zones-nastr {
    color: var(--font-secondary);
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.25;
    margin: 0;
    text-align: right;
}

.profile-hit-zones-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-mdl);
    width: 100%;
    min-width: 0;
}

@media (max-width: 639px) {
    .profile-hit-zones-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.profile-hit-zone-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    min-width: 0;
    padding: var(--spacing-mdl);
    border-radius: var(--radius-md-lg);
    background: var(--bg-content-secondary);
    box-sizing: border-box;
}

.profile-hit-zone-cell-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-3sm);
    width: 100%;
    min-width: 0;
}

.profile-hit-zone-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2px var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    line-height: 1.2;
    color: var(--btn-black-color);
}

.profile-hit-zone-pill--alpha {
    background: var(--profile-zone-bar-alpha);
}

.profile-hit-zone-pill--charlie {
    background: var(--profile-zone-bar-charlie);
}

.profile-hit-zone-pill--delta {
    background: var(--profile-zone-bar-delta);
}

.profile-hit-zone-pill--miss {
    background: var(--btn-black-bg);
    color: var(--btn-black-color);
}

.profile-hit-zone-pct {
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.25;
    color: var(--font-primary);
    min-width: 0;
}

.profile-hit-zone-count {
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: var(--line-height-list-description);
    color: var(--font-secondary);
}

/* Пустое состояние (Figma GcProfileCard empty): пилюля зоны + скруглённые полоски вместо % и счёта */
.profile-hit-zone-cell--placeholder {
    pointer-events: none;
}

.profile-hit-zone-cell-row--placeholder {
    gap: var(--spacing-xs);
}

.profile-hit-zone-skeleton-bar {
    display: block;
    flex-shrink: 0;
    height: var(--spacing-md);
    border-radius: var(--radius-full);
    background-color: var(--ui-border);
}

/* Ширины как в макете: ~29px / ~53px */
.profile-hit-zone-skeleton-bar--pct {
    width: 1.8125rem;
}

.profile-hit-zone-skeleton-bar--count {
    width: 3.3125rem;
}

/*
 * Попап результата упражнения (#stageBestResultPopup): те же ячейки и пилюли, что виджет «Попадания»,
 * сетка 2×2 как в макете Figma; в строке — число попаданий (в профиле там проценты).
 */
.profile-hit-zones-grid--stage-popup {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-xs);
}

.profile-hit-zones-grid--stage-popup .profile-hit-zone-cell {
    gap: 0;
    padding: var(--spacing-3sm) var(--spacing-sm);
}

.profile-hit-zones-grid--stage-popup .profile-hit-zone-cell-row {
    width: 100%;
}

.profile-hit-zones-grid--stage-popup .profile-hit-zone-pct {
    font-weight: 500;
}

.profile-top3-refresh-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1;
    color: var(--font-secondary);
    transition: color var(--transition-fast) var(--ease-out);
    white-space: nowrap;
}

.profile-top3-refresh-btn:hover {
    color: var(--font-primary);
}

.profile-top3-refresh-btn i {
    font-size: var(--font-size-md);
    line-height: 1;
}

/* ─── Help icon ──────────────────────────────────────────────────────────── */

.profile-help-icon {
    cursor: help;
    color: var(--font-secondary);
    margin-left: var(--spacing-xs);
    transition: color var(--transition-fast);
}

.profile-help-icon:hover {
    color: var(--font-secondary);
}

/* ─── Progress segments ──────────────────────────────────────────────────── */

.profile-progress-segment {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow) var(--ease-out);
}

.profile-progress--hoverable {
    cursor: help;
}

/* Сегменты вне профиля (напр. визиты подписки) — прежняя семантика */
.profile-progress-segment-success {
    background: linear-gradient(
        90deg,
        rgba(var(--success-color-rgb), 0.3) 0%,
        var(--success-color) 100%
    );
}

.profile-progress-segment-warning  { background-color: var(--warning-color); }
.profile-progress-segment-danger   { background-color: var(--danger-color); }
.profile-progress-segment-secondary { background-color: transparent; }
.profile-progress-segment-misses   { opacity: 1; }
.profile-progress-segment-empty    { width: 100%; }

/* ─── Widget header link ─────────────────────────────────────────────────── */

.profile-widget-link {
    color: var(--font-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.profile-widget-link:hover {
    color: var(--font-primary);
}

.profile-widget-link i {
    font-size: var(--font-size-sm);
}

/* ─── Weapon cards grid ──────────────────────────────────────────────────── */

.weapon-cards-grid {
    display: grid;
    gap: var(--spacing-mdl);
}

/* Одна карточка — на всю ширину; две — строго пополам (адаптив профиля). */
.weapon-cards-grid[data-weapon-count="1"] {
    grid-template-columns: 1fr;
}

.weapon-cards-grid[data-weapon-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weapon-cards-grid[data-weapon-count="3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weapon-cards-grid[data-weapon-count="3"] > .weapon-card-link:first-child {
    grid-column: 1 / -1;
}

@media (min-width: 992px) {
    .weapon-cards-grid[data-weapon-count="1"],
    .weapon-cards-grid[data-weapon-count="2"],
    .weapon-cards-grid[data-weapon-count="3"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .weapon-cards-grid[data-weapon-count="3"] > .weapon-card-link:first-child {
        grid-column: auto;
    }
}

/*
 * Узкая колонка (две карточки в ряд или нижний ряд из двух при трёх единицах): без слова «любимый» — остаётся сердце + тип.
 */
@media (max-width: 991.98px) {
    .weapon-cards-grid[data-weapon-count="2"] .weapon-card-strip-type-label-favorite-adj,
    .weapon-cards-grid[data-weapon-count="3"] > .weapon-card-link:nth-child(n + 2) .weapon-card-strip-type-label-favorite-adj {
        display: none;
    }

    .weapon-cards-grid[data-weapon-count="2"] .weapon-card-strip-type-label-noun--with-adj,
    .weapon-cards-grid[data-weapon-count="3"] > .weapon-card-link:nth-child(n + 2) .weapon-card-strip-type-label-noun--with-adj {
        display: none;
    }

    .weapon-cards-grid[data-weapon-count="2"] .weapon-card-strip-type-label-noun--solo,
    .weapon-cards-grid[data-weapon-count="3"] > .weapon-card-link:nth-child(n + 2) .weapon-card-strip-type-label-noun--solo {
        display: inline;
    }
}

.weapon-card-link {
    text-decoration: none;
    display: block;
}

/* ─── Activity Feed ──────────────────────────────────────────────────────── */

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.activity-feed-month {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Мелкий uppercase-лейбл месяца */
.activity-feed-month-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--font-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 var(--spacing-xs);
}

.activity-feed-events {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ─── Event card в контексте ленты — компактный list-item ─────────────────── */

.activity-feed .gc-event-card {
    padding: var(--spacing-3sm) var(--spacing-md);
    padding-right: 7rem; /* место под badge */
    min-height: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--ui-border);
}

.activity-feed .gc-event-card h5 {
    margin: 0 0 2px 0 !important;
}

.activity-feed .gc-event-card .text-truncate {
    font-size: var(--font-size-sm) !important;
    color: var(--font-secondary);
}

.activity-feed .gc-event-card .event-grid-bottom {
    margin-top: 0;
    gap: 0;
}

/* Badge позиционирование в компактной карточке */
.activity-feed .gc-event-card-badge {
    top: var(--spacing-3sm);
    right: var(--spacing-sm);
}

.activity-feed-more {
    text-align: center;
}

/* ─── Event card: badge ──────────────────────────────────────────────────── */

.gc-event-card {
    position: relative;
}

.gc-event-card-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
}

/* ─── Debug panel ────────────────────────────────────────────────────────── */

.profile-debug {
    background: var(--bg-content-secondary);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-family: monospace;
    font-size: 12px;
}

.profile-debug-title {
    border-bottom: 1px solid var(--ui-border);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

/* gc-widget-tip + gc-widget-tip-bubble → см. public/css/tooltips.css */

/* ─── График результатов (столбцы по ивентам) — макет Figma: сетка gap 12px, padding 12px, h 200px; колонка gap 12px, p 9px → токены; % в пилюле; трек 8px flex-1 ─ */

.profile-results-bars-chart {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--spacing-mdl);
    box-sizing: border-box;
    min-height: 200px;
    height: 200px;
    padding: var(--spacing-xs);
    margin-top: 0;
}

.profile-results-bar {
    flex: 1 1 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-mdl);
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    transition: opacity var(--transition-fast);
}

.profile-results-bar:focus-visible {
    outline: 2px solid var(--accent-link);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.profile-results-bar:hover {
    opacity: 0.92;
}

.profile-results-bar-pct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1;
    color: var(--font-primary);
    white-space: nowrap;
}

.profile-results-bar-track {
    flex: 1 1 0;
    width: var(--spacing-sm);
    min-height: 0;
    background-color: var(--bg-content-secondary);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.profile-results-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--profile-results-fill, 50) * 1%);
    min-height: 0;
    background-color: var(--font-primary);
    border-radius: var(--radius-full);
    opacity: var(--profile-results-fill-opacity, 1);
    transition:
        height var(--transition-slow) var(--ease-out),
        opacity var(--transition-slow) var(--ease-out);
}

.profile-results-bar-date {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: 1;
    color: var(--font-secondary);
    white-space: nowrap;
}

/* Статичные заглушки (Figma StatRow empty) — пилюля %, пустой трек 8px, пилюля даты */
.profile-results-bar--placeholder {
    pointer-events: none;
    cursor: default;
}

.profile-results-bar--placeholder:hover {
    opacity: 1;
}

.profile-results-bar-pct-placeholder {
    width: var(--spacing-2xl);
    height: var(--spacing-lg);
    border-radius: var(--radius-full);
    background-color: var(--bg-content-secondary);
    flex-shrink: 0;
}

.profile-results-bar-track--placeholder {
    flex: 1 1 0;
    width: var(--spacing-sm);
    min-height: 0;
    background-color: var(--bg-content-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.profile-results-bar-date-placeholder {
    width: var(--spacing-xl);
    height: var(--spacing-md);
    border-radius: var(--radius-full);
    background-color: var(--bg-content-secondary);
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .profile-results-bars-chart {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        scrollbar-gutter: stable;
    }

    .profile-results-bars-chart .profile-results-bar {
        flex: 0 0 var(--spacing-2-5xl);
        min-width: var(--spacing-2-5xl);
    }
}

.bar-chart-tooltip {
    position: fixed;
    display: none;
    background: var(--bg-content-main);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    z-index: var(--z-tooltip);
    min-width: 200px;
    max-width: 280px;
    pointer-events: none;
}

.bar-stat-meta {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--font-secondary);
    margin-bottom: var(--spacing-sm);
}

.bar-stat-event-name {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--font-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}

.bar-stat-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--font-secondary);
    margin-bottom: var(--spacing-sm);
}

.bar-stat-zones {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.bar-stat-zone {
    flex: 1;
    min-width: 64px;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    text-align: center;
}

.bar-stat-zone--alpha {
    background: rgba(var(--success-color-rgb), 0.15);
}

.bar-stat-zone--charlie {
    background: rgba(var(--warning-color-rgb), 0.15);
}

.bar-stat-zone--delta {
    background: rgba(var(--danger-color-rgb), 0.15);
}

.bar-stat-zone--miss {
    background: rgba(128, 128, 128, 0.12);
}

.bar-stat-zone-count {
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: 1;
}

.bar-stat-zone--alpha .bar-stat-zone-count {
    color: var(--success-color);
}

.bar-stat-zone--charlie .bar-stat-zone-count {
    color: var(--warning-color);
}

.bar-stat-zone--delta .bar-stat-zone-count {
    color: var(--danger-color);
}

.bar-stat-zone--miss .bar-stat-zone-count {
    color: var(--font-secondary);
}

.bar-stat-zone-label {
    font-size: var(--font-size-xs);
    color: var(--font-secondary);
    margin-top: var(--spacing-4xs);
}

.bar-stat-empty {
    font-size: var(--font-size-xs);
    color: var(--font-secondary);
    text-align: center;
    padding: var(--spacing-md) 0;
}

/* Виджет мероприятий сообществ / история на профиле: родитель без «карточки» */
.profile-widget.gc-event-feed-widget {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    isolation: auto;
    gap: var(--spacing-sm);
}

/* Один виджет: «Мероприятия сообществ» + «История» — крупный gap между секциями, внутри секции как раньше */
.profile-widget.gc-event-feed-widget.profile-events-feed {
    gap: var(--spacing-md);
}

.profile-events-feed-block {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 0;
}

.gc-event-feed-months {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-mdl);
}

/* Последний месяц свёрнут: контент скрыт, flex-gap родителя не даёт отступа после последнего
   ребёнка — чип прилипает к низу зоны --list / панели. Все ленты .gc-event-feed-months (профиль). */
.gc-event-feed-months > .gc-month-section:last-child.collapsed {
    margin-bottom: var(--spacing-mdl);
}

/* Внутри gc-panel-content--list: как у gc-list-group-header — выровнять чип месяца с контентом строк (xs панели + sm = как у gc-interactive-row) */
.gc-event-feed-months .gc-month-toggle-wrap {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

/* Месяц: список как у участников на странице мероприятия — gc-stack-sm между строками, без общей обводки */
.gc-event-feed-month-shell {
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.gc-event-feed-month-shell .gc-event-feed-list {
    gap: var(--spacing-sm);
}

.gc-event-feed-widget .gc-month-toggle,
.channel-linked-events-months .gc-month-toggle {
    padding: var(--spacing-3xs) var(--spacing-sm);
    color: var(--font-primary);
}

/* Список мероприятий канала: колонка действий — под меню «⋯», не под широкую CTA профиля */
.channel-linked-events-months .gc-event-feed-card-action-cell {
    flex: 0 0 auto;
    max-width: none;
    min-width: 0;
}

.gc-event-feed-month {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.gc-event-feed-month-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    padding: var(--spacing-3sm) var(--spacing-sm);
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-full);
    background: var(--bg-content-main);
    color: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1;
}

.gc-event-feed-month-chip i {
    font-size: var(--font-size-xs);
}

.gc-event-feed-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.gc-event-feed-card {
    border: none;
    border-radius: var(--radius-md-lg);
    background: transparent;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-mdl);
    position: relative;
    transition: background var(--transition-fast);
}

.gc-event-feed-card:hover {
    background-color: var(--gc-interactive-hover-bg);
    cursor: pointer;
}

/* История имён на профиле — те же карточки, без перехода по клику */
.gc-event-feed-card--name-history,
.gc-event-feed-card--name-history:hover {
    cursor: default;
}

.gc-event-feed-card-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

.gc-event-feed-card-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    gap: var(--spacing-4xs);
    display: flex;
    flex-direction: column;
}

.gc-event-feed-card-date {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--font-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-event-feed-card-title,
.gc-event-feed-card-subtitle {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--font-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.gc-event-feed-card-avatars {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
}

.gc-event-feed-organizer-wrap {
    display: inline-flex;
    border-radius: var(--radius-full);
}

/* Наложение: слева организатор, справа поверх — сообщество (как в Figma) */
.gc-event-feed-organizer-wrap--overlap .gc-event-feed-avatar--organizer {
    margin-right: -12px;
}

.gc-event-feed-avatar-stack {
    position: relative;
    z-index: 1;
}

.gc-event-feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 3px solid var(--bg-content-main);
    flex-shrink: 0;
    object-fit: cover;
    box-sizing: border-box;
}

.gc-event-feed-card:hover .gc-event-feed-avatar {
    border-color: var(--gc-interactive-hover-bg);
}

.gc-event-feed-community-link {
    display: inline-flex;
    border-radius: var(--radius-full);
}

/* Действие справа в одной строке с текстом (десктоп и адаптив) */
.gc-event-feed-card-action-cell {
    flex: 0 1 46%;
    min-width: 0;
    max-width: 46%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.gc-event-feed-card-action-cell .gc-event-feed-action {
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.gc-event-feed-card-action-cell .gc-event-feed-action-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gc-event-feed-card-action-cell .gc-event-feed-action-segmented .gc-event-feed-action-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

/* Участвую / заявка подана: gc-btn-black + disabled — без глобального серого фона .gc-btn[disabled] */
.gc-event-feed-card .gc-event-feed-action--request-sent.gc-btn-black:disabled,
.gc-event-feed-card .gc-event-feed-action--request-sent.gc-btn-black[disabled] {
    background-color: var(--btn-black-bg);
    color: var(--btn-black-color);
    border-color: var(--btn-black-border);
    opacity: 1;
    cursor: default;
}

.gc-event-feed-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    box-sizing: border-box;
    background: var(--ui-surface-1);
    border: 1px solid var(--ui-border);
    color: var(--font-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1;
}

.gc-event-feed-action-segmented {
    padding: 0 !important;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.gc-event-feed-action-main,
.gc-event-feed-action-price {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
}

.gc-event-feed-action-main {
    gap: var(--spacing-2xs);
    padding: 0 var(--spacing-sm);
    min-width: 0;
    justify-content: center;
}

.gc-event-feed-action-price {
    border-left: 1px solid var(--ui-border);
    padding: 0 var(--spacing-sm);
    font-weight: 600;
    color: var(--font-primary);
    white-space: nowrap;
}

/* ─── Логистика профиля: строка списка + подпись «Основной» на всю ширину айтема ─── */

.profile-logistics-list-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: var(--radius-md-lg);
    transition: background var(--transition-fast);
}

.profile-logistics-list-item.interactive:hover {
    background: var(--bg-content-secondary);
}

.profile-logistics-list-item > .gc-interactive-row {
    flex: 1;
    min-width: 0;
}

.profile-logistics-list-item--with-foot > .gc-interactive-row {
    padding-bottom: 0;
}

.profile-logistics-list-item-foot {
    width: 100%;
    box-sizing: border-box;
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-sm);
}

/* Как у транспорта в карточке участника: gap между номером и «…» */
.profile-logistics-list-item .gc-interactive-row > .gc-list-actions {
    gap: var(--spacing-sm);
}
