.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-bottom: 16px;
    font-size: 12px;
    line-height: 18px;
    color: var(--color-text-muted);
}

.detail-meta__flag {
    color: var(--color-warning);
}

.detail-meta a {
    color: inherit;
    text-decoration: none;
}

.detail-meta a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--control-height);
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-on-accent);
}

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

.btn-primary:active {
    background-color: var(--color-accent-pressed);
}

.btn-secondary {
    background-color: var(--color-surface-raised);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-secondary:hover {
    background-color: var(--color-surface-active);
    color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.btn-link {
    color: var(--color-accent);
    background: none;
    padding: 0;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.avatar-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-default__image {
    display: block;
    width: 78%;
    height: 78%;
    object-fit: contain;
}

.share-control {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.share-feedback {
    color: var(--color-success-text);
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}

.share-feedback[data-state="error"] {
    color: var(--color-error-text);
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}

.share-button:hover,
.share-button:focus-visible {
    background: var(--color-surface-active);
    color: var(--color-accent);
}

.share-button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.tag {
    background-color: var(--color-surface);
    color: var(--color-accent);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
}

.apply-box {
    display: inline-block;
}

.apply-box > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
}

.apply-box > summary::-webkit-details-marker {
    display: none;
}

.apply-form {
    margin-top: 14px;
    padding: 16px 18px;
    max-width: 480px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.status-badge.status-new {
    background: var(--color-info-bg);
    color: var(--color-info-text);
}

.status-badge.status-accepted {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.status-badge.status-rejected {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.status-badge.status-withdrawn,
.status-badge.status-removed,
.status-badge.status-left,
.status-badge.status-closed,
.status-badge.status-neutral {
    background: var(--color-neutral-bg);
    color: var(--color-neutral-text);
}

.event-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 16px;
}

.event-badge.available {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
}

.event-badge.planned {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.event-badge.completed {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
}

.form-card {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 32px;
    max-width: 720px;
    margin: 32px auto;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 5.6px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
}

.form-control, .form-select, .form-group input, .form-group textarea, .form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 10.4px 12.8px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    background: var(--color-bg);
}

/* Единый стандарт высоты полей и кнопок. Исключения — многострочные поля
   и multi-select: у них высота задаётся содержимым. */
input.form-control:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
select.form-control:not([multiple]),
.form-select:not([multiple]),
.form-group input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
.form-group select:not([multiple]),
.filter-select {
    height: var(--control-height);
    padding-top: 0;
    padding-bottom: 0;
}

/* Чекбоксы и радиокнопки — не поля ввода: не растягиваем их на всю ширину. */
.form-group input[type="checkbox"], .form-group input[type="radio"] {
    width: auto;
    padding: 0;
    align-self: flex-start;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-focus);
    box-shadow: var(--focus-ring);
}

.form-control--readonly {
    margin: 0;
    display: flex;
    align-items: center;
    min-height: var(--control-height);
    background: var(--color-surface-active);
    color: var(--color-text-secondary);
    cursor: default;
}

.form-text {
    color: var(--color-text-secondary);
    font-size: 14px;
}
.form-checks__label {
    font-size: 14px;
    font-weight: 600;
}

.form-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: auto;
    margin: 0;
    align-self: center;
}


/* Секции длинной формы: заголовок, короткая подсказка, поля подряд. */
.form-section {
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.form-section + .form-section {
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.form-section legend {
    padding: 0;
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
}

.form-section__hint {
    margin: 0 0 16px;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 18px;
}

/* Страница формы: основная колонка и подсказка справа, без пустой половины экрана. */
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(240px, 300px);
    gap: 32px;
    align-items: start;
    justify-content: center;
}

.form-layout .form-card {
    margin: 0;
    max-width: none;
}

.form-aside {
    position: sticky;
    top: 24px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-raised);
}

.form-aside__title {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 24px;
}

.form-aside ul {
    margin: 0 0 16px;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 20px;
}

.form-aside__section + .form-aside__section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.form-aside__facts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 16px;
}

.form-aside__fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-aside__fact dt {
    color: var(--color-text-secondary);
    font-size: 12px;
    line-height: 18px;
}

.form-aside__fact dd {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
}

.form-aside__note {
    display: block;
    margin-top: 2px;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 18px;
}

.form-aside__section .btn {
    margin-top: 4px;
}

.form-aside__link {
    font-size: 14px;
    color: var(--color-accent);
}

/* Необязательные поля не мешают заполнить основное, но остаются на месте. */
.form-advanced {
    margin: 0 0 24px;
    padding: 16px 20px;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-md);
}

.form-advanced__summary {
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--color-accent);
}

.form-advanced__body {
    margin-top: 20px;
}

/* --- Каркас детальной страницы: шапка-карточка и две колонки -------------
   Тот же рисунок, что у проекта и участника: статус, заголовок, действия,
   обложка; слева узкие «Детали», справа блоки содержания. */
.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 32px;
    align-items: start;
    padding: 24px;
    margin-bottom: 24px;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.detail-hero__flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-hero__title {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 34px;
    font-weight: 600;
}

.detail-hero__desc {
    max-width: var(--reading-width);
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 23px;
    color: var(--color-text-secondary);
}

.detail-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--button-gap);
    margin-top: 16px;
}

.detail-hero__cover {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* Фотография в шапке детальной страницы: блоки «кружочков», как на главной, но
   без плашек. Картинка чуть уходит влево (место под декор справа), пропорции и
   кадрирование не меняются: height: auto, без object-fit. */
.photo-decor {
    position: relative;
}

.photo-decor > img {
    display: block;
    position: relative;
    z-index: 1;
    width: calc(100% - 20px);
    height: auto;
    /* Небольшой отступ слева — место под второй блок точек. */
    margin-left: 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.photo-decor__dots {
    position: absolute;
    z-index: 0;
    background-image: radial-gradient(circle, var(--color-border-strong) 1.3px, transparent 1.4px);
    background-size: 9px 9px;
    opacity: 0.7;
}

.photo-decor__dots--top {
    top: -12px;
    right: -22px;
    width: 62px;
    height: 46px;
}

.photo-decor__dots--bottom {
    right: -18px;
    bottom: 8px;
    width: 34px;
    height: 64px;
}

/* Слева — тот же блок, но чуть ниже середины картинки. */
.photo-decor__dots--left {
    left: -22px;
    top: 56%;
    width: 34px;
    height: 64px;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 32px;
}

.detail-main {
    width: 75%;
}

.detail-side__card {
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.detail-side__title {
    margin: 0 0 16px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
}

.detail-facts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.detail-fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-fact dt {
    color: var(--color-text-secondary);
    font-size: 12px;
    line-height: 18px;
}

.detail-fact dd {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
}

.detail-block {
    margin-bottom: 28px;
}

.detail-block:last-child {
    margin-bottom: 0;
}

.detail-block__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.detail-block__head h2 {
    margin: 0;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
}

.detail-block__count {
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 18px;
}

.detail-hero__note {
    font-size: 13px;
    line-height: 20px;
    color: var(--color-text-secondary);
}

/* Люди события: организаторы и спикеры — строками, а не голым списком. */
.people-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.people-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.people-item__name {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.people-item__role {
    font-size: 12px;
    line-height: 18px;
    color: var(--color-text-muted);
}

.detail-text {
    max-width: var(--reading-width);
    font-size: 15px;
    line-height: 24px;
}

@media (max-width: 900px) {
    .detail-hero,
    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-main {
        width: 100%;
    }

    .photo-decor {
        order: -1;
    }

    .photo-decor > img {
        width: 100%;
        margin-left: 0;
    }

    .photo-decor__dots {
        display: none;
    }
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--button-gap);
    margin-top: 8px;
}

@media (max-width: 980px) {
    .form-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-aside {
        position: static;
        order: -1;
    }
}

/* Чекбокс с подписью в одну строку: квадрат слева, текст рядом. */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: auto;
    margin: 2px 0 0;
    padding: 0;
    align-self: flex-start;
}

.form-card__lead {
    margin: 0 0 16px;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 20px;
}

.account-info__note {
    color: var(--color-text-muted);
    font-size: 12px;
}

.form-error {
    color: var(--color-error-text);
    font-size: 14px;
}

.course-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    align-self: flex-start;
    background: var(--color-neutral-bg);
    color: var(--color-neutral-text);
}

.course-status.accepted {
    background: var(--color-success-bg); color: var(--color-success-text);
}

.course-status.in_progress {
    background: var(--color-info-bg); color: var(--color-info-text);
}

.course-status.failed {
    background: var(--color-error-bg); color: var(--color-error-text);
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin: 32px 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.filter-label {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.filter-select {
    height: var(--control-height);
    padding: 0 11.2px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
}

.project-status-badge, .event-badge {
    display: inline-block;
    font-size: 12px;
    padding: 2.4px 9.6px;
    border-radius: var(--radius-pill);
    background: var(--color-border);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.project-status-badge.active, .event-badge.published {
    background: var(--color-success-bg); color: var(--color-success-text);
}

.project-status-badge.in_development {
    background: var(--color-info-bg); color: var(--color-info-text);
}

.event-badge.draft {
    background: var(--color-neutral-bg); color: var(--color-neutral-text);
}

.event-badge.cancelled {
    background: var(--color-error-bg); color: var(--color-error-text);
}

.event-badge.completed, .project-status-badge.completed {
    background: var(--color-done-bg); color: var(--color-done-text);
}

.hp-wrap {
    display: none;
}

.filter-grow {
    flex: 1 1 260px;
}

.filter-actions {
    display: flex;
    gap: var(--button-gap);
    margin-left: auto;
    flex-shrink: 0;
}

.filter-reset {
    white-space: nowrap;
}

.course-score {
    font-weight: 700;
    color: var(--color-success-text);
    background: var(--color-success-bg);
    border-radius: var(--radius-pill);
    padding: 1.6px 8.8px;
    font-size: 14px;
    white-space: nowrap;
}

.team-primary {
    font-size: 12px;
    background: var(--color-info-bg);
    color: var(--color-info-text);
    border-radius: var(--radius-pill);
    padding: 1.6px 8px;
}

.course-badge {
    display: inline-block;
    padding: 3.2px 11.2px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.course-badge.available {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

.course-badge.in_development {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.course-badge.archived {
    background: var(--color-neutral-border);
    color: var(--color-neutral-text);
}

.service-icon {
    font-size: 26px;
}

.recruiting-badge {
    display: inline-block;
    padding: 2.4px 9.6px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    background: var(--color-success-bg);
    color: var(--color-success-text);
    white-space: nowrap;
}

.infra-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    font-size: 11px;
    color: var(--color-text-secondary);
}

.infra-note svg {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.editor-toolbar .form-text {
    margin: 0;
}

.tag-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-picker__selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-active);
    color: var(--color-accent);
    font-size: 12px;
}

.tag-chip__remove {
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}

.status-badge.status-draft {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.status-badge.status-published {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

/* Одна роль набора: карточка с подписями, стек — чипами, как технологии проекта. */
.role-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.role-row__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.role-row__field label {
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* Раскладка задана явно: «убрать роль» идёт первой в разметке (после скрытых
   полей), но стоит внизу карточки, а не в первой строке. */
.role-row__field--title {
    grid-row: 1;
    grid-column: 1;
}

.role-row__field--count {
    grid-row: 1;
    grid-column: 2;
}

.role-row__meta {
    grid-row: 2;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.role-row__field--tech {
    grid-row: 3;
    grid-column: 1 / -1;
}

.role-row__field--req {
    grid-row: 4;
    grid-column: 1 / -1;
}

.role-row__delete {
    grid-row: 5;
    grid-column: 1 / -1;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    cursor: pointer;
}

/* «Взять стек проекта» — ссылка-действие внутри роли, а не кнопка рядом с полем. */
.role-row__copy {
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-accent);
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
    cursor: pointer;
}

.role-row__copy:hover {
    color: var(--color-accent-hover);
}

/* Пустая строка набора — это приглашение добавить роль, а не обычное поле. */
.role-row:last-child {
    border-style: dashed;
}

@media (max-width: 640px) {
    .role-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .role-row__field--count {
        grid-column: 1;
        grid-row: auto;
    }

    .role-row__meta {
        grid-template-columns: 1fr;
    }
}

.update-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}

.update-badge--important {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.update-badge--critical {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.stretched-link {
    color: inherit;
}

.stretched-link:hover {
    color: var(--color-accent);
}

.link-above {
    position: relative;
    z-index: 2;
}

/* Строки «моих» страниц (статьи, проекты, мероприятия, курсы, заявки) */
.my-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.my-list__title {
    margin: 32px 0 16px;
    font-size: 20px;
}

.my-item {
    position: relative;
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-raised);
}

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

.my-item__head h3 {
    margin: 0;
    font-size: 16px;
    line-height: 22px;
    font-weight: 600;
    color: var(--color-text);
}

.my-item__desc {
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 18px;
    margin: 6px 0 10px;
}

.my-item .detail-meta {
    margin-bottom: 10px;
}

.my-item__actions {
    display: flex;
    gap: var(--button-gap);
    align-items: center;
    flex-wrap: wrap;
}

.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: none;
}

.card-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-active);
    color: var(--color-accent);
}

.card-cover-placeholder svg {
    width: 28px;
    height: 28px;
}

.status-badge, .project-status-badge, .event-badge, .course-badge, .update-badge, .recruiting-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    align-self: flex-start;
}

.event-badge, .project-status-badge {
    margin-bottom: 0;
}

.form-card {
    background: var(--color-surface-raised);
    padding: 24px;
    max-width: var(--reading-width);
    margin: 0 0 24px;
}

.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-active);
    color: var(--color-accent);
}

.service-icon svg {
    width: 20px;
    height: 20px;
}

.meta-metric {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.meta-metric .meta-icon {
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
}

.meta-metric--link {
    color: inherit;
    text-decoration: none;
}

.meta-metric--link:hover {
    color: var(--color-accent);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-raised);
    color: var(--color-text-secondary);
    transition: border-color 0.15s, color 0.15s;
}

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

.like-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-raised);
    color: var(--color-text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

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

.like-button--active {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.like-button--static {
    cursor: default;
}

/* Единый рейтинг статьи: лайки минус дизлайки, может быть отрицательным. */
.vote-score {
    display: inline-flex;
    align-items: center;
    min-width: 24px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: var(--radius-pill);
    background: var(--color-surface-active);
    vertical-align: middle;
}

.vote-score--big {
    min-width: 40px;
    justify-content: center;
    padding: 4px 10px;
    font-size: 15px;
    line-height: 20px;
}

.vote-score--positive {
    color: var(--color-accent);
}

.vote-score--negative {
    color: var(--color-error);
}

.like-button--dislike.like-button--active {
    border-color: var(--color-error);
    color: var(--color-error);
}

.article-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--button-gap);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--color-overlay);
    cursor: zoom-out;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lightbox);
}

/* Подтверждение действия: нативный <dialog> центрируется сам, оформление — как у карточек. */
body.has-modal {
    overflow: hidden;
}

.confirm-dialog {
    width: min(440px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-raised);
    color: var(--color-text);
    box-shadow: var(--shadow-lightbox);
}

.confirm-dialog::backdrop {
    background: var(--color-modal-backdrop);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.confirm-dialog[open] {
    animation: confirm-dialog-in 0.16s ease;
}

.confirm-dialog__body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 24px 16px;
}

.confirm-dialog__icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface-active);
    color: var(--color-accent);
}

.confirm-dialog__icon svg {
    width: 20px;
    height: 20px;
}

.confirm-dialog__content {
    min-width: 0;
}

.confirm-dialog__title {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
}

.confirm-dialog__text {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 22px;
}

.confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--button-gap);
    padding: 0 24px 24px;
}

.confirm-dialog__actions .btn {
    min-width: 112px;
}

.confirm-dialog__actions .btn:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

@keyframes confirm-dialog-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 420px) {
    .confirm-dialog__body {
        padding: 20px 20px 14px;
    }

    .confirm-dialog__actions {
        padding: 0 20px 20px;
    }

    .confirm-dialog__actions .btn {
        flex: 1;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .confirm-dialog[open] {
        animation: none;
    }
}

/* Общий выпадающий список подсказок: пикер меток и текстовые поля с подсказками. */
.tag-picker,
.suggest {
    position: relative;
}

.suggest-menu {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-menu);
}

.suggest-menu__group {
    padding: 8px 8px 4px;
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.suggest-menu__option {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-text);
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
}

.suggest-menu__option:hover,
.suggest-menu__option:focus-visible,
.suggest-menu__option.is-active {
    background: var(--color-surface-active);
    outline: none;
}


/* Строки формы образования в настройках: поле + кнопка-крестик. */
.education-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.education-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.education-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.education-row__remove {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.education-row__remove input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.education-row__remove:hover {
    border-color: var(--color-error);
    color: var(--color-error);
}

.education-row__remove:focus-within {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.education-row:has(.education-row__remove input:checked) {
    display: none;
}


/* Фото профиля: превью, загрузка и удаление без файлового поля Django. */
.profile-form > .form-section:first-of-type {
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.profile-form .form-text {
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 18px;
}

.avatar-field {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-field__preview {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background-color: var(--color-surface);
}

.avatar-field__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-field__preview img[hidden] {
    display: none;
}

.avatar-field__initials {
    color: var(--color-text-muted);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}

.avatar-field.has-photo .avatar-field__initials {
    display: none;
}

.avatar-field.is-cleared .avatar-field__initials {
    display: inline-flex;
}

.avatar-field.is-cleared .avatar-field__preview img {
    display: none;
}

.avatar-field__body {
    min-width: 0;
}

.avatar-field__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--button-gap);
}

.avatar-field__upload {
    cursor: pointer;
}

.avatar-field input[type="file"]:focus-visible + .avatar-field__upload,
.avatar-field__clear:focus-within {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.avatar-field__clear {
    background-color: var(--color-surface-raised);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

.avatar-field__clear:hover {
    border-color: var(--color-error);
    color: var(--color-error);
}

.avatar-field__hint {
    margin: 8px 0 0;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 18px;
}

@media (max-width: 520px) {
    .avatar-field {
        align-items: flex-start;
        gap: 16px;
    }

    .avatar-field__preview {
        width: 72px;
        height: 72px;
    }
}

/* Заглушка обложки: брендированный фон вместо пустого серого прямоугольника. */
.card-cover-placeholder {
    flex-direction: column;
    gap: 10px;
    background:
        radial-gradient(circle, var(--color-border) 1px, transparent 1px) 0 0 / 18px 18px,
        linear-gradient(135deg, var(--color-surface-active), var(--color-surface-raised));
}

.card-cover-placeholder::after {
    content: "S21Party";
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card-cover-placeholder svg {
    width: 34px;
    height: 34px;
}

/* FAQ: вопросы раскрываются на месте, без отдельного JS. */
.faq-list {
    max-width: 820px;
    margin: 0 auto 24px;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-item:first-child {
    border-top: 1px solid var(--color-border);
}

.faq-item__question {
    position: relative;
    padding: 18px 36px 18px 0;
    cursor: pointer;
    list-style: none;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: var(--color-text);
}

.faq-item__question::-webkit-details-marker {
    display: none;
}

.faq-item__question::after {
    content: "+";
    position: absolute;
    top: 16px;
    right: 4px;
    color: var(--color-accent);
    font-size: 20px;
    line-height: 24px;
}

.faq-item[open] .faq-item__question::after {
    content: "−";
}

.faq-item__answer {
    padding: 0 36px 18px 0;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 23px;
}

.faq-item__answer p:first-child {
    margin-top: 0;
}

.faq-item__answer p:last-child {
    margin-bottom: 0;
}

.faq-more {
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 23px;
    text-align: center;
}

.faq-more a {
    color: var(--color-accent);
    font-weight: 600;
}
