/* ===================================================================
   Лента автомобилистов — кабинет
   =================================================================== */

.feed-dashboard { padding-bottom: 1.5rem; }

.feed-dashboard-head { margin-bottom: 0.6rem; }
.feed-dashboard-head h1 {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.35rem;
}
.feed-dashboard-head p {
    color: var(--gray-500);
    font-size: 0.95rem;
    max-width: 40rem;
}

.feed-dashboard .card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.65rem;
}

/* Баннер машины — только в режиме ленты по машине */
.feed-vehicle-banner[hidden] { display: none !important; }
.feed-vehicle-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, var(--primary-50) 0%, #fff 70%);
    border-color: var(--primary-200);
}
.feed-vehicle-back {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.feed-vehicle-back:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
}
.feed-vehicle-banner-body {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}
.feed-vehicle-banner-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-100);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--gray-200);
}
.feed-vehicle-banner-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-vehicle-banner-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-600);
    margin-bottom: 0.2rem;
}
.feed-vehicle-banner-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.25rem;
}
.feed-vehicle-swatch,
.feed-post-vehicle-swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: var(--swatch, var(--gray-300));
    border: 1px solid rgb(0 0 0 / 0.08);
    flex-shrink: 0;
}
.feed-vehicle-banner-meta {
    font-size: 0.88rem;
    color: var(--gray-600);
}

/* Композер */
.feed-composer { padding: 0.85rem 1rem; }
.feed-composer-top {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}
.feed-composer--collapsed .feed-composer-extra {
    display: none;
}
.feed-composer-extra {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}
.feed-composer-text {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    resize: none;
    line-height: 1.45;
    min-height: 2.375rem;
    max-height: 9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), min-height 0.2s ease;
}
.feed-composer:not(.feed-composer--collapsed) .feed-composer-text {
    min-height: 5rem;
    resize: vertical;
}
.feed-composer-text:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.12);
}
.feed-composer-row {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}
.feed-composer-field label,
.feed-composer-field .feed-field-label,
.feed-filter label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.feed-composer-field-grow { min-width: 0; }
.feed-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 2.375rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-primary);
    font-size: 0.92rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: #fff;
}
.feed-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.12);
}
.feed-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}
.feed-attach-btn,
.feed-publish-btn {
    min-height: 2.375rem;
    height: 2.375rem;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.feed-publish-btn {
    padding: 0 0.9rem;
    gap: 0.35rem;
}
.feed-publish-btn.is-loading {
    opacity: 0.88;
    pointer-events: none;
}

/* Фильтры */
.feed-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.65rem 0.85rem;
    padding: 0.85rem;
    align-items: end;
}
.feed-filter .custom-select-trigger,
.feed-composer .custom-select-trigger {
    min-height: 2.375rem;
    height: 2.375rem;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.92rem;
    line-height: 1.25;
    box-sizing: border-box;
}
.feed-filter .input-with-icon { position: relative; }
.feed-filter .input-with-icon i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}
.feed-filter-tags .input-with-icon i {
    pointer-events: auto;
    cursor: pointer;
}
.feed-filter-tags .input-with-icon i:hover { color: var(--primary-500); }
.feed-filter .feed-input,
.feed-filter .input-with-icon .feed-input {
    height: 2.375rem;
    min-height: 2.375rem;
    max-height: 2.375rem;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    line-height: 1.25;
    box-sizing: border-box;
}
.feed-filter .input-with-icon .feed-input { padding-left: 2.1rem; }
.feed-filter-actions { display: flex; align-items: flex-end; }
.feed-filter-actions .btn {
    min-height: 2.375rem;
    height: 2.375rem;
    width: 100%;
    padding: 0 0.75rem;
    font-size: 0.92rem;
    border-radius: var(--radius-md);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    line-height: 1;
}

/* Теги-чипы в форме поста */
.feed-tags-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.375rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: #fff;
    cursor: text;
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.feed-tags-input:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.12);
}
.feed-tags-chips {
    display: contents;
}
.feed-tags-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.35rem 0.2rem 0.5rem;
    background: var(--primary-50);
    color: var(--primary-800);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
}
.feed-tags-chip button {
    border: none;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 1.1rem;
    height: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.65rem;
}
.feed-tags-chip button:hover {
    color: var(--error);
    background: rgb(239 68 68 / 0.1);
}
.feed-tags-field {
    flex: 1 1 80px;
    min-width: 60px;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 0.92rem;
    padding: 0.15rem 0.25rem;
    min-height: 1.5rem;
}
.feed-tags-field::placeholder { color: var(--gray-400); }

.feed-filter.is-disabled { opacity: 0.6; pointer-events: none; }
.feed-filter-vehicle.is-disabled { opacity: 1; pointer-events: auto; }

.custom-select.is-disabled { opacity: 0.6; pointer-events: none; }

/* Аватары */
.feed-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gray-100);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
}
.feed-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-composer-top .feed-avatar { width: 2.375rem; height: 2.375rem; margin-top: 0.05rem; }
.feed-avatar-lg { width: 2.75rem; height: 2.75rem; font-size: 1.1rem; }
.feed-avatar-sm { width: 2rem; height: 2rem; font-size: 0.85rem; }

.feed-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius);
    border: 1px dashed var(--gray-300);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 0.85rem;
    cursor: pointer;
}
.feed-attach-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
}
.feed-attach-count { font-size: 0.75rem; color: var(--gray-400); }
.feed-attach-preview,
.feed-comment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.feed-attach-thumb {
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}
.feed-attach-thumb-sm { width: 3rem; height: 3rem; }
.feed-attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-attach-remove {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    width: 1.35rem;
    height: 1.35rem;
    border: none;
    border-radius: 50%;
    background: rgb(0 0 0 / 0.55);
    color: #fff;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-list { display: flex; flex-direction: column; gap: 0.65rem; }
.feed-stream { margin-top: 0.15rem; }
.feed-loading,
.feed-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--gray-500);
}
.feed-loading i { margin-right: 0.5rem; color: var(--primary-500); }
.feed-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.feed-more-wrap { text-align: center; margin-top: 1.25rem; }

.feed-post { padding: 1.1rem 1.15rem; }
.feed-post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.feed-post-author { flex: 1; min-width: 0; }
.feed-post-name {
    display: block;
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--gray-900);
}
.feed-post-time { font-size: 0.78rem; color: var(--gray-400); }
.feed-post-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.feed-post-edit,
.feed-post-delete {
    border: none;
    background: transparent;
    color: var(--gray-400);
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.feed-post-edit:hover {
    color: var(--primary-600);
    background: rgb(14 165 233 / 0.08);
}
.feed-post-delete:hover {
    color: var(--error);
    background: rgb(239 68 68 / 0.08);
}

.feed-post-vehicle-row { margin-bottom: 0.65rem; }
.feed-post-vehicle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform 0.15s ease;
}
.feed-post-vehicle:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}
.feed-post-vehicle-name { font-weight: 600; }

.feed-post-body {
    font-size: 0.97rem;
    line-height: 1.6;
    color: var(--gray-800);
    margin-bottom: 0.65rem;
    word-break: break-word;
}
.feed-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}
.feed-tag {
    border: none;
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
}
.feed-tag:hover { background: var(--primary-100); }

.feed-gallery {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.feed-gallery--1 { grid-template-columns: 1fr; }
.feed-gallery--2 { grid-template-columns: 1fr 1fr; }
.feed-gallery--3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.feed-gallery--3 .feed-gallery-item:first-child { grid-row: span 2; }
.feed-gallery--4 { grid-template-columns: 1fr 1fr; }
.feed-gallery--5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.feed-gallery--5 .feed-gallery-item:first-child { grid-row: span 2; }
.feed-gallery-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--gray-100);
    cursor: zoom-in;
    overflow: hidden;
    border-radius: var(--radius-md);
}
.feed-gallery--1 .feed-gallery-item { aspect-ratio: 16 / 10; max-height: 400px; }
.feed-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.feed-gallery-item:hover img { transform: scale(1.03); }

.feed-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem 0;
    border-top: 1px solid var(--gray-100);
}
.feed-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--gray-50);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform 0.15s ease;
}
.feed-reaction-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    transform: translateY(-1px);
}
.feed-reaction-btn.is-active {
    background: var(--primary-100);
    border-color: var(--primary-400);
    box-shadow: 0 0 0 2px rgb(14 165 233 / 0.15);
}
.feed-reaction-emoji { font-size: 1.05rem; line-height: 1; }
.feed-reaction-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    min-width: 0.5rem;
}

.feed-comments-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-size: 0.88rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
}
.feed-comments-toggle:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}
.feed-comments-label { font-weight: 500; }

.feed-comments {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-100);
}
.feed-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.feed-comment { display: flex; gap: 0.55rem; align-items: flex-start; }
.feed-comment-body { flex: 1; min-width: 0; }
.feed-comment-bubble {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
}
.feed-comment-name {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--gray-800);
    margin-bottom: 0.15rem;
}
.feed-comment-bubble p {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.5;
    margin: 0;
}
.feed-comment-bubble .feed-gallery { margin-top: 0.5rem; margin-bottom: 0; }
.feed-comment-bubble .feed-gallery-item { aspect-ratio: 4/3; max-height: 130px; }
.feed-comment-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.25rem;
    padding-left: 0.25rem;
    font-size: 0.72rem;
    color: var(--gray-400);
}
.feed-comment-delete {
    border: none;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}
.feed-comment-delete:hover { color: var(--error); }
.feed-comment-form textarea {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}
.feed-comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgb(14 165 233 / 0.1);
}
.feed-comment-attach-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.feed-attach-btn-sm { padding: 0.35rem 0.5rem; }

.feed-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgb(0 0 0 / 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.feed-lightbox[hidden] { display: none !important; }
.feed-lightbox img {
    max-width: min(100%, 1100px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}
.feed-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.15);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Редактирование поста */
.feed-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgb(15 23 42 / 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.feed-edit-modal[hidden] { display: none !important; }
.feed-edit-dialog {
    width: min(100%, 640px);
    max-height: min(92vh, 900px);
    overflow: auto;
    padding: 1rem 1.1rem 1.1rem;
}
.feed-edit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.feed-edit-head h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--gray-900);
}
.feed-edit-close {
    border: none;
    background: transparent;
    color: var(--gray-500);
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.feed-edit-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}
.feed-edit-dialog .feed-composer-text {
    min-height: 5rem;
    margin-bottom: 0.75rem;
}
.feed-edit-dialog .feed-attach-preview {
    margin-top: 0.65rem;
}
.feed-edit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.feed-edit-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.feed-edit-dialog .custom-select-trigger {
    min-height: 2.375rem;
    height: 2.375rem;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.92rem;
    box-sizing: border-box;
}

.custom-select.is-disabled { opacity: 0.6; pointer-events: none; }

@media (max-width: 720px) {
    .feed-composer-row { grid-template-columns: 1fr; }
    .feed-gallery--5 { grid-template-columns: 1fr 1fr; }
    .feed-gallery--5 .feed-gallery-item:first-child { grid-row: span 1; grid-column: span 2; }
}
