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

:root {
    --bg:      #020617;
    --surf:    rgba(15, 23, 42, 0.95);
    --surf2:   rgba(15, 23, 42, 0.6);
    --border:  rgba(148, 163, 184, 0.12);
    --border2: rgba(148, 163, 184, 0.06);
    --accent:  #a855f7;
    --accent2: #38bdf8;
    --text:    #e2e8f0;
    --muted:   #64748b;
    --success: #22c55e;
    --danger:  #ef4444;
    --warn:    #f59e0b;
    --pin:     #fbbf24;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 700; }
em, i { font-style: italic; }
u { text-decoration: underline; }
s { text-decoration: line-through; }

/* ── Header ── */
.site-header {
    background: rgba(2,6,23,0.92); border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 100;
}
.header-inner {
    max-width: 80vw; margin: 0 auto; padding: 0 32px;
    display: flex; align-items: center; gap: 20px; height: 54px;
}
.logo { font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: -.3px; }
.header-nav { display: flex; gap: 4px; }
.header-nav a {
    color: var(--muted); font-size: 14px; font-weight: 500;
    padding: 5px 10px; border-radius: 8px; transition: color .15s, background .15s;
}
.header-nav a:hover, .header-nav a.active { color: var(--text); background: rgba(255,255,255,0.06); text-decoration: none; }
.header-nav a.projects-link {
    background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(56,189,248,0.15));
    border: 1px solid rgba(168,85,247,0.3);
    color: var(--accent);
    font-weight: 600;
}
.header-nav a.projects-link:hover {
    background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(56,189,248,0.25));
    border-color: rgba(168,85,247,0.5);
}
.user-block { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-nick { font-weight: 700; font-size: 15px; color: var(--accent); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168,85,247,0.5); box-shadow: 0 0 0 1px rgba(168,85,247,0.2); }
.btn-login { padding: 6px 14px; background: #9146ff; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-login:hover { background: #7c3fe4; }
.btn-logout { padding: 5px 10px; background: transparent; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 12px; }
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── User greeting block ── */
.user-greeting-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.user-greeting-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-greeting-hello {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.user-greeting-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.user-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
}

.user-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.btn-logout-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-logout-new:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

/* ── Breadcrumb ── */
.breadcrumb {
    max-width: 80vw; margin: 0 auto; padding: 10px 32px 0;
    font-size: 15px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.breadcrumb:empty {
    display: none;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb .sep { color: var(--border2); margin: 0 2px; }
.breadcrumb span { color: var(--text); }

.breadcrumb-back-btn {
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-back-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateX(-2px);
}

/* ── Layout ── */
.app-container { max-width: 80vw; margin: 0 auto; padding: 16px 32px 60px; font-size: 16px; }

/* ── Spinner ── */
.spinner {
    width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section header ── */
.section-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.section-header h1 { font-size: 28px; font-weight: 800; }
.section-header h2 { font-size: 24px; font-weight: 700; }
.section-header p  { font-size: 16px; color: var(--muted); margin-top: 2px; }

/* ── Forum hero banner ── */
.forum-hero {
    background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(56,189,248,0.08));
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: 18px; padding: 28px 28px 24px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 20px;
}
.forum-hero-icon { font-size: 48px; flex-shrink: 0; }
.forum-hero-text h1 { font-size: 24px; font-weight: 800; background: linear-gradient(135deg,#a855f7,#38bdf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.forum-hero-text p  { color: var(--muted); font-size: 14px; margin-top: 4px; }
.forum-stats { display: flex; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.forum-stat { text-align: center; }
.forum-stat strong { display: block; font-size: 20px; font-weight: 800; color: var(--text); }
.forum-stat span   { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ══════════════════════════════════════════════════════
   НОВЫЙ КОМПАКТНЫЙ HERO БЛОК
══════════════════════════════════════════════════════ */
.forum-hero-compact {
    position: relative;
    height: 320px;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.fhc-bg {
    position: absolute;
    inset: 0;
    background: url('/forum.png') center/cover;
    animation: fhcZoom 20s ease-in-out infinite;
}

@keyframes fhcZoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fhc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,10,20,0.98) 0%, rgba(10,10,20,0.92) 30%, rgba(10,10,20,0.75) 60%, rgba(10,10,20,0.4) 100%);
    z-index: 1;
}

.fhc-content {
    position: relative;
    z-index: 2;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    justify-content: center;
}

.fhc-title {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.fhc-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.fhc-badge {
    display: inline-block;
    width: fit-content;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.25);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #22c55e;
    margin-top: 10px;
}

/* ══════════════════════════════════════════════════════
   БЛОК АКТИВНОСТИ (Grid: 2fr 1fr 1fr - более широкие блоки)
══════════════════════════════════════════════════════ */
.activity-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 36px;
}

.activity-panel {
    background: var(--surf);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 20px rgba(168, 85, 247, 0.2);
    animation: activityGlow 3s ease-in-out infinite;
}

@keyframes activityGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 15px rgba(168, 85, 247, 0.2);
        border-color: rgba(168, 85, 247, 0.4);
    }
    50% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 25px rgba(168, 85, 247, 0.4);
        border-color: rgba(168, 85, 247, 0.6);
    }
}

.activity-main {
    /* Левая панель визуально важнее */
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border2);
    background: rgba(168, 85, 247, 0.08);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.activity-icon {
    font-size: 18px;
}

.activity-body {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
}

.activity-body::-webkit-scrollbar {
    width: 6px;
}

.activity-body::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.05);
    border-radius: 3px;
}

.activity-body::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 3px;
}

.activity-body::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

.activity-view-all {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid var(--border2);
}

.btn-view-all {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 999px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-view-all:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    text-decoration: none;
}

/* Что нового - items */
.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border2);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    cursor: pointer;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
}

.wn-avatar, .activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.wn-avatar-ph, .activity-avatar-ph {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin-top: 3px;
}

.activity-author {
    font-weight: 600;
    color: var(--text);
}

.activity-dot {
    color: var(--border);
}

.activity-time {
    white-space: nowrap;
}

.activity-reply-icon {
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.activity-item:hover .activity-reply-icon {
    opacity: 1;
    transform: scale(1.1);
}

.activity-reply-icon.locked {
    opacity: 0.3;
    filter: grayscale(1);
}

/* Горячие темы - items */
.activity-hot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border2);
    cursor: pointer;
    transition: background 0.15s;
}

.activity-hot-item:last-child {
    border-bottom: none;
}

.activity-hot-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.hot-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hot-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Новые игроки - items */
.activity-player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border2);
    cursor: pointer;
    transition: background 0.15s;
}

.activity-player-item:last-child {
    border-bottom: none;
}

.activity-player-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.player-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-nick {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-time {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.activity-empty {
    padding: 36px 20px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

/* ══════════════════════════════════════════════════════
   МИКРО-ДЕТАЛИ (бейджи, индикаторы)
══════════════════════════════════════════════════════ */
.badge-new {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    margin-left: 6px;
    vertical-align: middle;
}

.badge-hot {
    display: inline-block;
    font-size: 12px;
    margin-left: 4px;
    animation: hotPulse 2s ease-in-out infinite;
}

@keyframes hotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.player-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.player-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--surf);
    box-shadow: 0 0 6px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ══════════════════════════════════════════════════════
   РАЗДЕЛИТЕЛЬ (фиолетовые пунктирные линии с длинными штрихами)
══════════════════════════════════════════════════════ */
.forum-separator {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 32px 0 24px;
}

.separator-line {
    flex: 1;
    height: 2px;
    background-image: repeating-linear-gradient(
        to right,
        var(--accent) 0px,
        var(--accent) 12px,
        transparent 12px,
        transparent 20px
    );
    opacity: 0.4;
}

.separator-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    padding: 0 8px;
}

/* Category list */
.categories { display: flex; flex-direction: column; gap: 12px; }

/* ══════════════════════════════════════════════════════
   ОБНОВЛЁННЫЕ КАРТОЧКИ КАТЕГОРИЙ
   Layout: icon → name/desc → (at 70%) topic count → last post → arrow
══════════════════════════════════════════════════════ */
.category-card-new {
    display: grid;
    grid-template-columns: 70px 1fr auto auto 50px;
    align-items: center;
    gap: 20px;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-card-new:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
}

.cat-icon-new {
    font-size: 36px;
    flex-shrink: 0;
    text-align: center;
}

.cat-info {
    flex: 1;
    min-width: 0;
}

.cat-name-new {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-desc-new {
    font-size: 14px;
    color: var(--muted);
    margin-top: 5px;
}

.cat-stats-compact {
    text-align: center;
    padding: 0 20px;
    border-left: 1px solid var(--border2);
    flex-shrink: 0;
}

.cat-count-compact {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    display: block;
    line-height: 1;
}

.cat-label-compact {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 5px;
}

.cat-last-post {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 240px;
    max-width: 320px;
    padding: 0 16px;
    border-left: 1px solid var(--border2);
}

.cat-last-post-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-last-post-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-last-post-author {
    font-weight: 600;
    color: var(--text);
}

.cat-arrow {
    font-size: 24px;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.category-card-new:hover .cat-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

.cat-empty-activity {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
}

/* ── Category hub (страница-выбор подкатегорий) ── */
.cat-hub { display: flex; flex-direction: column; gap: 20px; }
.cat-hub-header {
    display: flex; align-items: center; gap: 16px;
    background: var(--surf); border: 1px solid var(--border);
    border-radius: 16px; padding: 20px 22px;
}
.cat-hub-icon { font-size: 36px; flex-shrink: 0; }
.cat-hub-name { font-size: 20px; font-weight: 800; color: var(--text); }
.cat-hub-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.cat-hub-grid { display: flex; flex-direction: column; gap: 10px; }
.cat-hub-card {
    display: grid; grid-template-columns: 40px 1fr auto;
    align-items: center; gap: 14px;
    background: var(--surf); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px 20px;
    cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.cat-hub-card:hover { border-color: rgba(168,85,247,0.45); background: rgba(15,23,42,0.98); transform: translateX(3px); }
.chc-icon { font-size: 22px; text-align: center; }
.chc-name { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chc-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.chc-right { text-align: right; }
.chc-count { font-size: 20px; font-weight: 800; color: var(--accent); display: block; }
.chc-label { font-size: 11px; color: var(--muted); }

.category-card {
    display: grid; grid-template-columns: 48px 1fr auto;
    align-items: center; gap: 14px;
    background: var(--surf); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px 18px;
    cursor: pointer; transition: border-color .15s, background .15s;
    text-decoration: none; color: inherit;
}
.category-card:hover { border-color: rgba(168,85,247,0.4); background: rgba(15,23,42,0.98); text-decoration: none; }
.cat-icon { font-size: 30px; text-align: center; }
.cat-name { font-weight: 700; font-size: 18px; }
.cat-name .ro { font-size: 11px; font-weight: 600; background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.cat-desc { font-size: 14px; color: var(--muted); margin-top: 2px; }
.cat-right { text-align: right; white-space: nowrap; }
.cat-count { font-size: 20px; font-weight: 800; color: var(--text); display: block; }
.cat-label { font-size: 12px; color: var(--muted); }
.cat-activity { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Posts list ── */
.posts-list { display: flex; flex-direction: column; gap: 4px; }
.post-row {
    display: grid; grid-template-columns: 1fr auto;
    gap: 8px 12px; align-items: center;
    background: var(--surf); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 16px;
    cursor: pointer; transition: border-color .15s;
}
.post-row:hover { border-color: rgba(168,85,247,0.35); }
.post-row.pinned { border-left: 3px solid var(--pin); }
.post-row.locked { opacity: .7; }
.post-title-row { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 6px; }
.post-sub { font-size: 15px; color: var(--muted); margin-top: 2px; }
.post-counters { text-align: right; font-size: 14px; color: var(--muted); white-space: nowrap; }
.post-counters strong { font-size: 20px; font-weight: 700; color: var(--text); display: block; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .e-icon { font-size: 36px; margin-bottom: 10px; }

/* ── Pagination ── */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 20px; }
.pager button {
    padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surf); color: var(--text); cursor: pointer; font-size: 13px;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); }
.pager button.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ── New post button ── */
.btn-new {
    padding: 9px 18px; background: linear-gradient(135deg,#7c3aed,#a855f7);
    color: #fff; border: none; border-radius: 10px; font-size: 13px;
    font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.btn-new:hover { opacity: .88; }

/* ══════════════════════════════════════════════════════
   FORUM FOOTER
══════════════════════════════════════════════════════ */
.forum-footer {
    margin-top: 40px;
    padding: 20px 24px;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.forum-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.forum-footer-terra {
    width: 50px;
    height: auto;
    object-fit: contain;
}

.forum-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.forum-footer-brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.forum-footer-copy {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.2;
}

.forum-footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.forum-footer-server-info {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    line-height: 1.4;
}

.forum-footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.forum-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.forum-footer-link:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    text-decoration: none;
}

.forum-footer-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.forum-footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.forum-footer-version {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.forum-footer-ip {
    font-size: 12px;
    color: var(--muted);
    font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
    .forum-footer {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 16px;
    }
    
    .forum-footer-left,
    .forum-footer-right {
        justify-content: center;
    }
    
    .forum-footer-right {
        align-items: center;
    }
}

/* ══════════════════════════════════════════════════════
   Classic forum post block (author left | content right)
══════════════════════════════════════════════════════ */
.forum-block {
    display: grid; grid-template-columns: 150px 1fr;
    background: var(--surf); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; margin-bottom: 8px;
}
.forum-block.is-op { border-left: 3px solid var(--accent); }

/* Author column */
.fb-author {
    padding: 20px 14px; background: rgba(15,23,42,0.75);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; text-align: center;
}
.fb-avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168,85,247,0.4); flex-shrink: 0; box-shadow: 0 4px 16px rgba(168,85,247,0.2); }
.fb-avatar-placeholder {
    width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg,#7c3aed,#a855f7);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: #fff; border: 2px solid rgba(168,85,247,0.4);
}
.fb-nick { font-weight: 700; font-size: 16px; color: var(--accent); word-break: break-word; }
.fb-joined { font-size: 11px; color: var(--muted); line-height: 1.4; }
.fb-posts { font-size: 11px; color: var(--muted); background: rgba(255,255,255,0.04); border: 1px solid var(--border2); border-radius: 6px; padding: 2px 7px; margin-top: 2px; }
.fb-badge { font-size: 11px; font-weight: 700; color: var(--pin); background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.2); border-radius: 6px; padding: 2px 7px; }
.fb-admin-badge { color: var(--accent); background: rgba(168,85,247,0.1); border-color: rgba(168,85,247,0.2); }

/* Content column */
.fb-body { display: flex; flex-direction: column; min-width: 0; }
.fb-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px; border-bottom: 1px solid var(--border2);
    background: rgba(15,23,42,0.3); font-size: 12px; color: var(--muted); gap: 8px;
}
.fb-header-left { display: flex; align-items: center; gap: 8px; }
.fb-title { font-size: 24px; font-weight: 800; color: var(--text); padding: 14px 16px 4px; line-height: 1.35; }
.fb-content { padding: 12px 16px 14px; font-size: 17px; line-height: 1.85; color: #cbd5e1; word-break: break-word; flex: 1; }
.fb-content img:not(.mc-tex) { max-width: 100%; max-height: 480px; border-radius: 8px; margin: 6px 0; display: block; }
.fb-content img.mc-tex { display: inline-block; vertical-align: middle; }
.fb-content strong { color: var(--text); }
.fb-footer { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--border2); background: rgba(15,23,42,0.2); }

/* Reply separator */
.replies-header { font-size: 14px; color: var(--muted); padding: 12px 4px 6px; }

/* ── Action buttons ── */
.btn-act {
    padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border);
    background: transparent; color: var(--muted); cursor: pointer; font-size: 12px;
    transition: border-color .15s, color .15s;
}
.btn-act:hover { border-color: var(--danger); color: var(--danger); }
.btn-act.pin:hover   { border-color: var(--pin);    color: var(--pin); }
.btn-act.lock:hover  { border-color: var(--muted);  color: var(--text); }

/* ── Badge ── */
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; margin-left: 4px; }
.badge.pinned { background: rgba(251,191,36,.15); color: var(--pin); }
.badge.locked { background: rgba(148,163,184,.1); color: var(--muted); }

/* ── Minecraft block texture images (inline, pixelated) ── */
/* Used in editor and post content when inserting block icons */
img.mc-tex {
    width: 24px; height: 24px;
    image-rendering: pixelated; image-rendering: crisp-edges;
    vertical-align: middle; display: inline-block;
    border-radius: 3px; margin: 0 3px 0 0;
    /* Don't let the global fb-content img rule override size */
    max-width: 24px !important; max-height: 24px !important;
    flex-shrink: 0;
}

/* ── Editor (WYSIWYG) ── */
.editor-wrap { display: flex; flex-direction: column; gap: 0; position: relative; }
.editor-toolbar {
    display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
    background: rgba(30,41,59,0.5); border: 1px solid var(--border);
    border-bottom: none; border-radius: 10px 10px 0 0; padding: 8px 10px;
}
.tb {
    min-width: 36px; height: 34px; border: none; background: transparent; color: var(--muted);
    border-radius: 7px; cursor: pointer; font-size: 15px; display: flex;
    align-items: center; justify-content: center; transition: background .1s, color .1s;
    padding: 0 8px;
}
.tb-wide { min-width: 52px; font-size: 12px; font-weight: 600; }
.tb:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.tb.active {
    background: rgba(168,85,247,0.2);
    color: #c084fc;
    box-shadow: inset 0 0 0 1px rgba(168,85,247,0.4);
}
.tb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 5px; }

/* ── URL insert popup ── */
.url-popup {
    position: fixed;
    z-index: 9700;
    width: 320px;
    background: radial-gradient(circle at top left, rgba(56,189,248,0.08), transparent 60%),
        linear-gradient(135deg, rgba(15,23,42,0.98), rgba(15,23,42,0.96));
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(56,189,248,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
.url-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
.url-popup-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid rgba(148,163,184,0.1);
    font-size: 13px; font-weight: 700; color: #e2e8f0;
}
.url-popup-close {
    width: 26px; height: 26px; border-radius: 7px;
    border: 1px solid var(--border); background: transparent;
    color: var(--muted); font-size: 16px; cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.url-popup-close:hover { border-color: var(--danger); color: var(--danger); }
.url-popup-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.url-field { display: flex; flex-direction: column; gap: 5px; }
.url-field label {
    font-size: 11px; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.url-field input {
    padding: 9px 12px; border-radius: 9px;
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(2,6,23,0.6); color: #e2e8f0;
    font-size: 13px; font-family: inherit; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.url-field input:focus { border-color: rgba(56,189,248,0.5); box-shadow: 0 0 0 3px rgba(56,189,248,0.1); }
.url-popup-err { font-size: 11px; color: #f87171; min-height: 14px; }
.url-popup-footer { display: flex; gap: 8px; justify-content: flex-end; padding-top: 2px; }
.url-popup-btn {
    padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: opacity 0.15s; border: none;
}
.url-popup-btn.primary {
    background: linear-gradient(135deg, #38bdf8, #a855f7);
    color: #0b1120;
    box-shadow: 0 4px 14px rgba(56,189,248,0.25);
}
.url-popup-btn.primary:hover { opacity: 0.88; }
.url-popup-btn.ghost {
    background: transparent;
    border: 1px solid rgba(148,163,184,0.2);
    color: #94a3b8;
}
.url-popup-btn.ghost:hover { background: rgba(148,163,184,0.08); color: #e2e8f0; }

/* WYSIWYG contenteditable body */
.editor-body {
    width: 100%; min-height: 140px;
    background: rgba(30,41,59,0.7); border: 1px solid var(--border);
    border-radius: 0 0 10px 10px; padding: 12px; color: var(--text);
    font-family: inherit; font-size: 14px; line-height: 1.7; outline: none;
    transition: border-color .15s; word-break: break-word;
    cursor: text;
}
.editor-body:focus { border-color: rgba(168,85,247,0.45); }
.editor-body.drag-over {
    border-color: rgba(168,85,247,0.7);
    background: rgba(168,85,247,0.07);
    box-shadow: inset 0 0 0 2px rgba(168,85,247,0.25);
}
.editor-body.drag-over::after {
    content: '📷 Отпустите для загрузки';
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    background: rgba(168,85,247,0.08);
    border-radius: 0 0 10px 10px;
    color: #c084fc;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}
.editor-notice {
    margin-top: 6px;
    padding: 8px 14px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 12px;
    text-align: center;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.editor-body:empty::before {
    content: attr(data-placeholder);
    color: var(--muted); pointer-events: none;
}
.editor-body img.ed-img {
    max-width: 100%; max-height: 400px; border-radius: 8px;
    margin: 6px 0; display: block; cursor: default;
}
.editor-body pre.fc-code {
    white-space: pre-wrap; min-height: 36px; cursor: text;
}
.editor-body blockquote.fc-quote { cursor: text; }
.editor-body details.fc-spoiler { cursor: text; }
.editor-body details.fc-spoiler summary { cursor: pointer; }

.form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.char-count { font-size: 12px; color: var(--muted); }
.btn-submit {
    padding: 9px 22px; background: linear-gradient(135deg,#7c3aed,#a855f7);
    color: #fff; border: none; border-radius: 10px; font-size: 14px;
    font-weight: 600; cursor: pointer;
}
.btn-submit:hover:not(:disabled) { opacity: .88; }
.btn-submit:disabled { opacity: .4; cursor: not-allowed; }

/* ── Emoji picker (categorized) ── */
.emoji-wrap { position: relative; display: inline-block; }
.emoji-picker {
    background: #0f172a; border: 1px solid rgba(168,85,247,0.3);
    border-radius: 14px; width: 300px;
    position: absolute; bottom: calc(100% + 8px); left: 0;
    z-index: 300; box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}
.ep-tabs {
    display: flex; gap: 2px; padding: 8px 8px 0;
    border-bottom: 1px solid rgba(148,163,184,0.1);
}
.ep-tab {
    flex: 1; height: 34px; border: none; background: transparent;
    border-radius: 8px 8px 0 0; font-size: 18px; cursor: pointer;
    transition: background .1s; color: var(--muted);
}
.ep-tab:hover  { background: rgba(255,255,255,0.06); }
.ep-tab.active { background: rgba(168,85,247,0.15); color: var(--text); }
.ep-grid {
    display: grid; grid-template-columns: repeat(8, 1fr);
    gap: 2px; padding: 8px; max-height: 180px; overflow-y: auto;
}
.ep-grid::-webkit-scrollbar { width: 4px; }
.ep-grid::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 4px; }
.ep-hidden { display: none !important; }
.e-item {
    width: 100%; aspect-ratio: 1; font-size: 20px; border: none; background: transparent;
    border-radius: 7px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .1s;
}
.e-item:hover { background: rgba(255,255,255,0.1); }

/* ── New post form ── */
.new-post-form { background: var(--surf); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-top: 8px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.form-group select, .form-group input {
    width: 100%; background: rgba(30,41,59,0.7);
    border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 14px; color: var(--text);
    font-family: inherit; font-size: 14px; outline: none; transition: border-color .15s;
}
.form-group select:focus, .form-group input:focus { border-color: rgba(168,85,247,0.45); }
.form-group select option { background: #0f172a; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-cancel { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.btn-cancel:hover { border-color: var(--text); color: var(--text); }

/* ── Notice ── */
.notice { padding: 13px 16px; border-radius: 11px; font-size: 13px; margin-bottom: 14px; }
.notice.info  { background: rgba(56,189,248,0.08);  border: 1px solid rgba(56,189,248,0.2);  color: #7dd3fc; }
.notice.warn  { background: rgba(245,158,11,0.08);  border: 1px solid rgba(245,158,11,0.25); color: #fbbf24; }
.notice.error { background: rgba(239,68,68,0.08);   border: 1px solid rgba(239,68,68,0.2);   color: #fca5a5; }

/* ── Мобильный адаптив ── */
@media (max-width: 640px) {
    /* Header */
    .site-header { position: sticky; top: 0; }
    .header-inner { padding: 0 12px; height: 48px; gap: 10px; }
    .logo { font-size: 14px; }
    .header-nav { display: none; }
    .user-block { gap: 8px; font-size: 13px; }
    .user-nick { max-width: 90px; font-size: 13px; }
    .btn-login { padding: 5px 10px; font-size: 12px; }

    /* Layout */
    .app-container { padding: 10px 12px 48px; }
    .breadcrumb { padding: 8px 12px 0; font-size: 12px; }

    /* Hero */
    .forum-hero { flex-direction: column; gap: 10px; }
    .hero-stats-row { gap: 12px; }
    .hs strong { font-size: 18px; }
    .hero-who { margin-top: 6px; }
    .who-chips { gap: 6px; }
    .who-chip { font-size: 11px; padding: 3px 8px; }
    
    /* Новый компактный hero */
    .forum-hero-compact { height: 120px; border-radius: 12px; }
    .fhc-content { padding: 16px; gap: 6px; }
    .fhc-title { font-size: 20px; }
    .fhc-subtitle { font-size: 13px; }
    .fhc-badge { font-size: 11px; padding: 3px 10px; }

    /* Forum blocks (post view) */
    .forum-block { grid-template-columns: 1fr; }
    .fb-author {
        flex-direction: row; padding: 10px 12px;
        border-right: none; border-bottom: 1px solid var(--border2);
        gap: 10px; text-align: left;
    }
    .fb-avatar, .fb-avatar-placeholder { width: 46px; height: 46px; font-size: 16px; }
    .fb-joined, .fb-posts { display: none; }
    .fb-body { padding: 12px 14px; }
    .fb-title { font-size: 15px; }
    .fb-content { font-size: 13px; }

    /* Categories */
    .category-card { grid-template-columns: 32px 1fr auto; gap: 10px; padding: 12px 14px; }
    .cat-icon { font-size: 18px; }
    .cat-name { font-size: 13px; }
    .cat-desc { font-size: 11px; display: none; }
    .cat-last { font-size: 11px; }
    .cat-count { font-size: 16px; }
    .subcats-row { padding: 6px 10px; gap: 6px; flex-wrap: wrap; }
    .subcat-item { padding: 6px 10px; font-size: 12px; }
    
    /* Новые карточки категорий */
    .category-card-new {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }
    
    .cat-left {
        width: 100%;
        gap: 12px;
    }
    
    .cat-icon-new {
        font-size: 24px;
        width: 40px;
    }
    
    .cat-name-new {
        font-size: 14px;
    }
    
    .cat-desc-new {
        font-size: 12px;
    }
    
    .cat-right-new {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .cat-activity {
        max-width: 100%;
        font-size: 10px;
    }
    
    .cat-count-new {
        font-size: 18px;
    }

    /* Post list */
    .post-item { padding: 10px 14px; gap: 8px; }
    .post-title { font-size: 13px; }
    .post-meta  { font-size: 11px; flex-wrap: wrap; gap: 4px; }
    .post-stat  { gap: 4px; font-size: 11px; }

    /* Section header */
    .section-header { flex-direction: column; gap: 8px; }
    .section-header h1 { font-size: 17px; }
    .section-header h2 { font-size: 15px; }
    .section-actions { flex-wrap: wrap; gap: 6px; }
    .search-input { width: 100%; }

    /* New post form */
    .np-layout { grid-template-columns: 1fr; gap: 12px; }
    .np-sidebar { order: -1; }

    /* Editor */
    .editor-area { min-height: 140px; font-size: 13px; }
    .editor-toolbar { flex-wrap: wrap; gap: 2px; }

    /* Panels (sidebar panels on main page) */
    .panels-grid { grid-template-columns: 1fr; }
    
    /* Новый блок активности */
    .activity-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .activity-header {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .activity-item {
        padding: 10px 14px;
        gap: 10px;
    }
    
    .activity-title {
        font-size: 13px;
    }
    
    .activity-meta {
        font-size: 11px;
    }
    
    .activity-hot-item,
    .activity-player-item {
        padding: 9px 14px;
    }
    
    .hot-title {
        font-size: 12px;
    }
    
    .player-nick {
        font-size: 12px;
    }

    /* Mat widget */
    .mw-items { grid-template-columns: 1fr 1fr; }

    /* Contribution modal */
    .cm-inner { margin: 12px; }

    /* "Что нового" */
    .wn-item { padding: 8px 12px; gap: 8px; }
    .wn-body .wn-title { font-size: 12px; }
    .wn-body .wn-sub   { font-size: 10px; }

    /* Pagination */
    .pager { flex-wrap: wrap; gap: 4px; }
    .pager-btn { padding: 6px 10px; font-size: 12px; }

    /* Reply list */
    .replies-header { font-size: 13px; padding: 10px 14px; }
    .new-post-form  { padding: 14px; }

    /* Forum notice */
    .notice { padding: 12px 14px; font-size: 13px; }
}

/* ── "Что нового" block ── */
.whats-new { 
    background: var(--surf); 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    margin-bottom: 20px; 
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.wn-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 14px 18px 12px; 
    border-bottom: 1px solid var(--border2);
    background: rgba(56, 189, 248, 0.05);
}
.wn-header h2 { 
    font-size: 16px; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    color: var(--text);
}
.wn-header h2::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:.4; } }
.wn-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--border2); text-decoration: none; color: inherit; transition: background .1s; }
.wn-item:last-child { border-bottom: none; }
.wn-item:hover { background: rgba(255,255,255,0.03); text-decoration: none; }
.wn-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.wn-avatar-ph { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#7c3aed,#a855f7); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0; }
.wn-icon { font-size: 14px; flex-shrink: 0; }
.wn-body { flex: 1; min-width: 0; }
.wn-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wn-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.wn-time { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.wn-empty { padding: 20px 18px; font-size: 13px; color: var(--muted); text-align: center; }
.wn-nick  { font-weight: 700; color: var(--text); }
.wn-more-btn {
    display: block; width: 100%; padding: 10px;
    background: transparent; border: none; border-top: 1px solid var(--border2);
    color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.wn-more-btn:hover { background: rgba(168,85,247,.06); }
.wn-collapse-btn {
    padding: 4px 12px;
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 6px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.wn-collapse-btn:hover {
    background: rgba(168,85,247,0.15);
    border-color: rgba(168,85,247,0.4);
}

/* ── Категория с расширенной карточкой ── */
.cat-group { margin-bottom: 6px; }
.cat-group .category-card { border-radius: 14px 14px 0 0; margin-bottom: 0; border-bottom: none; }
.cat-group.no-subs .category-card { border-radius: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.subcats-row { background: rgba(15,23,42,0.6); border: 1px solid var(--border); border-top: none; border-radius: 0 0 14px 14px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 0; }
.subcat-item { display: flex; align-items: center; gap: 8px; padding: 9px 16px; cursor: pointer; flex: 1 1 200px; border-right: 1px solid var(--border2); border-bottom: 1px solid var(--border2); transition: background .1s; text-decoration: none; color: inherit; }
.subcat-item:hover { background: rgba(168,85,247,0.06); text-decoration: none; }
.subcat-item:last-child { border-right: none; }
.sub-name { font-size: 13px; font-weight: 600; }
.sub-desc { font-size: 11px; color: var(--muted); margin-top: 1px; }
.sub-count { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* Category card last post */
.cat-last { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.cat-last a { color: var(--muted); }
.cat-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.b-new  { background: rgba(34,197,94,.15);  color: var(--success); border: 1px solid rgba(34,197,94,.25);  font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }
.b-hot  { background: rgba(239,68,68,.12);  color: #f87171;        border: 1px solid rgba(239,68,68,.25);  font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }
.b-ro   { background: rgba(239,68,68,.1);   color: #fca5a5;        border: 1px solid rgba(239,68,68,.2);   font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 6px; }

/* ── Bottom panels grid ── */
.panels-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 14px; 
    margin-bottom: 24px;
}

/* ── Compact panels grid (3 в ряд с прокруткой) ── */
.panels-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media(max-width:900px){ 
    .panels-grid { grid-template-columns: 1fr; }
    .panels-grid-compact { grid-template-columns: 1fr; }
}

.panel { 
    background: var(--surf); 
    border: 1px solid var(--border); 
    border-radius: 14px; 
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s, box-shadow 0.15s;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15);
}

/* Компактная панель с фиксированной высотой */
.panel-compact {
    display: flex;
    flex-direction: column;
    height: 320px;
}

.panel-header { 
    padding: 12px 14px; 
    border-bottom: 1px solid var(--border2); 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--text);
    background: rgba(168, 85, 247, 0.05);
    display: flex; 
    align-items: center; 
    gap: 6px;
    flex-shrink: 0;
}

.panel-body { 
    padding: 4px 0; 
}

/* Прокручиваемое тело панели */
.panel-body-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-body-scrollable::-webkit-scrollbar {
    width: 6px;
}

.panel-body-scrollable::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

.panel-body-scrollable::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 3px;
}

.panel-body-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

.panel-item { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 10px 14px; 
    transition: background .1s;
    text-decoration: none;
    color: inherit;
}

.panel-item:hover { 
    background: rgba(255,255,255,0.03); 
    text-decoration: none;
}

/* Специальный стиль для постов в "Что нового" */
.panel-post-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border2);
}

.panel-post-item:last-child {
    border-bottom: none;
}

.pi-avatar { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    object-fit: cover; 
    flex-shrink: 0; 
}

.pi-avatar-ph { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    background: linear-gradient(135deg,#7c3aed,#a855f7); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 13px; 
    font-weight: 800; 
    color: #fff; 
    flex-shrink: 0; 
}

.pi-nick { 
    font-size: 13px; 
    font-weight: 600; 
    flex: 1; 
    min-width: 0; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

.pi-val { 
    font-size: 11px; 
    color: var(--muted); 
    white-space: nowrap; 
}

.pi-title { 
    font-size: 13px; 
    flex: 1; 
    min-width: 0; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap;
    line-height: 1.4;
}

.pi-meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-empty { 
    padding: 20px 14px; 
    font-size: 12px; 
    color: var(--muted); 
    text-align: center;
}

/* ── Projects Page ── */
.projects-page {
    max-width: 100%;
}

.projects-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .projects-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Компактная карточка проекта (для панелей) */
.project-card-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border2);
    cursor: pointer;
    transition: background 0.15s;
}

.project-card-compact:last-child {
    border-bottom: none;
}

.project-card-compact:hover {
    background: rgba(255, 255, 255, 0.03);
}

.project-card-compact .project-image,
.project-card-compact .project-image-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.project-card-compact .project-image-placeholder {
    background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(56,189,248,0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.project-compact-info {
    flex: 1;
    min-width: 0;
}

.project-compact-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-compact-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* Полная карточка проекта */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 16px;
    align-items: center;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    transition: border-color 0.15s, transform 0.15s;
}

.project-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateX(2px);
}

.project-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border);
}

.project-image-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(56,189,248,0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 2px solid var(--border);
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.project-author {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.project-description {
    font-size: 15px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}

.project-approval-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.project-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.project-join-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.project-join-btn:hover:not(:disabled) {
    opacity: 0.88;
}

.project-join-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.project-author-badge {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
}

/* Модальное окно создания проекта */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.project-modal-inner {
    background: #0f172a;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 18px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.project-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 18px;
    font-weight: 700;
}

.project-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.project-modal-close:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.project-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.project-modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-upload {
    padding: 8px 16px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-upload:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
}

/* Улучшенные стили для формы создания проекта */
.project-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.project-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
}

.project-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s;
}

.project-textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.btn-preview {
    padding: 10px 20px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    color: #38bdf8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-preview:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary:hover {
    opacity: 0.88;
}

/* Модальное окно предпросмотра проекта */
.project-preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.project-preview-inner {
    background: #0f172a;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 18px;
    font-weight: 700;
}

.project-preview-body {
    padding: 20px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .project-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .project-image,
    .project-image-placeholder {
        width: 100%;
        height: 200px;
    }
    
    .project-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .project-modal-inner,
    .project-preview-inner {
        max-width: 100%;
        margin: 0;
    }
}

/* Forum hero expanded */
.forum-hero { padding: 24px 26px 20px; }
.hero-main { display: flex; align-items: flex-start; gap: 18px; }
.hero-icon-big { font-size: 52px; flex-shrink: 0; }
.hero-title { font-size: 22px; font-weight: 800; }
.hero-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.hero-stats-row { display: flex; gap: 20px; margin-top: 14px; flex-wrap: wrap; }
.hs { text-align: center; }
.hs strong { display: block; font-size: 20px; font-weight: 800; }
.hs span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.hero-who { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-who-label { font-size: 12px; color: var(--muted); }
.who-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.who-chip { font-size: 12px; background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2); color: var(--accent); border-radius: 20px; padding: 3px 10px; font-weight: 500; }

/* ── Post tag badge ── */
.post-tag { display:inline-flex; align-items:center; gap:3px; font-size:11px; font-weight:700; border-radius:6px; padding:2px 8px; border:1px solid; margin-right:6px; vertical-align:middle; white-space:nowrap; }

/* ── Tag selector ── */
.tag-selector { margin-bottom:4px; }
.ts-label { font-size:12px; color:var(--muted); font-weight:600; margin-bottom:8px; }
.tag-chips { display:flex; flex-wrap:wrap; gap:6px; }
.tag-chip {
    font-size:12px; font-weight:600; border-radius:20px; padding:4px 12px;
    border:1px solid var(--border); background:transparent; color:var(--muted);
    cursor:pointer; user-select:none; transition:all .15s;
}
.tag-chip:hover { border-color:var(--accent); color:var(--text); }
.tag-chip.active { background:var(--tbg,rgba(168,85,247,.15)); color:var(--tc,var(--accent)); border-color:var(--tb,rgba(168,85,247,.3)); }

/* ── Category picker (step 1) ── */
.cat-picker-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; margin-top:4px; }
.cat-pick-card {
    background:var(--surf); border:1px solid var(--border); border-radius:14px;
    padding:18px 16px; cursor:pointer; transition:border-color .15s,transform .1s;
    text-align:center;
}
.cat-pick-card:hover { border-color:rgba(168,85,247,.45); transform:translateY(-2px); }
.cpk-icon { font-size:32px; margin-bottom:8px; }
.cpk-name { font-weight:700; font-size:14px; margin-bottom:4px; }
.cpk-desc { font-size:12px; color:var(--muted); margin-bottom:8px; }
.cpk-subs { display:flex; flex-wrap:wrap; justify-content:center; gap:4px; margin-bottom:6px; }
.cpk-subs span { font-size:10px; background:rgba(168,85,247,.1); color:var(--accent); border-radius:4px; padding:1px 6px; }
.cpk-count { font-size:11px; color:var(--muted); }
.subcat-picker-row { display:flex; flex-wrap:wrap; gap:8px; }
.subcat-pick { background:var(--surf); border:1px solid var(--border); border-radius:10px; padding:8px 14px; font-size:13px; font-weight:600; cursor:pointer; transition:border-color .15s; }
.subcat-pick:hover { border-color:var(--accent); color:var(--accent); }

/* ── New post two-column layout ── */
.np-layout { display:grid; grid-template-columns:1fr 300px; gap:20px; margin-top:16px; }
@media(max-width:768px){ .np-layout { grid-template-columns:1fr; } }
.np-main { display:flex; flex-direction:column; gap:0; }
.np-aside { display:flex; flex-direction:column; gap:12px; }

/* Category infobar */
.cat-infobar {
    display:flex; align-items:center; gap:14px;
    background:linear-gradient(135deg,rgba(168,85,247,.1),rgba(56,189,248,.06));
    border:1px solid rgba(168,85,247,.2); border-radius:14px; padding:14px 18px; margin-bottom:16px;
}
.cib-icon { font-size:28px; flex-shrink:0; }
.cib-info { flex:1; }
.cib-name { font-weight:700; font-size:16px; }
.cib-desc { font-size:12px; color:var(--muted); margin-top:2px; }
.cib-back { font-size:13px; color:var(--muted); white-space:nowrap; }
.cib-back:hover { color:var(--text); }

/* Title preview */
.title-preview { background:rgba(30,41,59,.4); border:1px solid var(--border); border-radius:10px; padding:10px 14px; margin-top:8px; }
.tp-label { font-size:11px; color:var(--muted); margin-bottom:6px; }
.tp-row { display:flex; align-items:center; gap:6px; font-size:14px; }

/* Aside cards */
.aside-card { background:var(--surf); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.aside-title { font-size:12px; font-weight:700; color:var(--muted); padding:10px 14px 8px; border-bottom:1px solid var(--border2); text-transform:uppercase; letter-spacing:.4px; }
.aside-tips { padding:10px 14px; list-style:none; display:flex; flex-direction:column; gap:6px; }
.aside-tips li { font-size:12px; color:var(--muted); padding-left:12px; position:relative; }
.aside-tips li::before { content:'·'; position:absolute; left:0; }
.aside-rules { border-color:rgba(239,68,68,.2); }
.aside-rules .aside-title { color:var(--danger); border-color:rgba(239,68,68,.15); }

/* Templates */
.template-chips { display:flex; flex-wrap:wrap; gap:6px; padding:10px 14px; }
.tpl-btn { background:rgba(30,41,59,.6); border:1px solid var(--border); border-radius:8px; padding:6px 10px; font-size:12px; font-weight:600; color:var(--text); cursor:pointer; transition:border-color .15s,background .15s; }
.tpl-btn:hover { border-color:var(--accent); background:rgba(168,85,247,.1); }

/* Aside recent posts */
.aside-posts { display:flex; flex-direction:column; }
.ap-item { display:flex; align-items:center; gap:6px; padding:8px 14px; border-bottom:1px solid var(--border2); text-decoration:none; color:inherit; transition:background .1s; }
.ap-item:last-child { border-bottom:none; }
.ap-item:hover { background:rgba(255,255,255,.03); text-decoration:none; }
.ap-title { font-size:12px; flex:1; min-width:0; }
.ap-meta { font-size:11px; color:var(--muted); white-space:nowrap; }

/* BBCode rendered elements (shared by editor + post view) */
.fc-code { background:rgba(0,0,0,.4); border:1px solid var(--border); border-radius:8px; padding:12px; font-family:monospace; font-size:13px; overflow-x:auto; margin:8px 0; white-space:pre-wrap; }
.fc-quote { border-left:3px solid var(--accent); padding:8px 14px; background:rgba(168,85,247,.07); border-radius:0 8px 8px 0; margin:6px 0; color:#94a3b8; }
.fc-spoiler {
    background: rgba(30,41,59,.5);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 6px 0;
    overflow: hidden;
}
.fc-spoiler summary {
    cursor: pointer;
    font-size: 0; /* hides the raw text node "Спойлер" */
    user-select: none;
    list-style: none;
    padding: 9px 14px;
    display: block;
    outline: none;
    transition: background .12s;
}
.fc-spoiler summary::-webkit-details-marker { display: none; }
.fc-spoiler summary:hover { background: rgba(168,85,247,.07); }
/* Closed: show ▶ Спойлер */
.fc-spoiler:not([open]) summary::before {
    content: '▶ Спойлер';
    font-size: 13px;
    font-weight: 700;
    color: #c084fc;
    letter-spacing: .2px;
}
/* Open: show small close hint, no title */
.fc-spoiler[open] summary::after {
    content: '▲ скрыть';
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}
.fc-spoiler > div {
    padding: 6px 14px 12px;
    border-top: 1px solid var(--border2);
}

/* ── Post preview modal ── */
.preview-modal {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pm-inner {
    background: #0f172a; border: 1px solid rgba(168,85,247,0.25);
    border-radius: 18px; width: 100%; max-width: 740px;
    max-height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.pm-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid rgba(148,163,184,0.1);
}
.pm-header-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.pm-close {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border);
    background: transparent; color: var(--muted); font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.pm-close:hover { border-color: var(--danger); color: var(--danger); }
.pm-body { overflow-y: auto; padding: 16px 20px 20px; }
.pm-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pm-title-text { font-size: 18px; font-weight: 800; }
.pm-content { font-size: 14px; line-height: 1.75; color: #cbd5e1; word-break: break-word; }
.pm-content img:not(.mc-tex) { max-width:100%; max-height:480px; border-radius:8px; margin:6px 0; display:block; }
.pm-content img.mc-tex { display: inline-block; vertical-align: middle; }

/* ── Litematic uploader ── */
.litematic-drop {
    border: 2px dashed rgba(168,85,247,0.2); border-radius: 10px;
    padding: 14px 10px; text-align: center; cursor: pointer;
    margin: 8px 14px 10px; transition: border-color .15s, background .15s;
    user-select: none;
}
.litematic-drop:hover, .litematic-drop.drag-over {
    border-color: rgba(168,85,247,0.55); background: rgba(168,85,247,0.06);
}
.ld-icon { font-size: 24px; margin-bottom: 4px; }
.ld-text { font-size: 11px; color: var(--muted); line-height: 1.5; }
.ld-text span { color: var(--accent); font-weight: 500; }

.litematic-result { padding: 0 14px 12px; }
.lr-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0 8px; border-top: 1px solid var(--border2);
}
.lr-name { font-size: 11px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.lr-insert-btn {
    font-size: 12px; background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.25); color: var(--accent);
    border-radius: 6px; padding: 3px 7px; cursor: pointer;
}
.lr-insert-btn:hover { background: rgba(168,85,247,0.2); }

/* ── Block grid (inventory style) ── */
.blk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 46px);
    gap: 3px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 2px;
}
.blk-grid::-webkit-scrollbar { width: 3px; }
.blk-grid::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 3px; }

.blk-cell { cursor: default; }
.blk-slot {
    width: 46px; height: 46px;
    background: #1a2332;
    border: 2px solid #2a3a52;
    border-right-color: #0d1620;
    border-bottom-color: #0d1620;
    border-radius: 3px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .1s;
    overflow: hidden;
}
.blk-cell:hover .blk-slot {
    border-color: rgba(168,85,247,0.7);
    background: #1e2d42;
}
.blk-tex {
    width: 40px; height: 40px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
}
.blk-placeholder {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; color: var(--muted);
    background: rgba(255,255,255,0.04); border-radius: 2px;
}
.blk-count {
    position: absolute; bottom: 1px; right: 2px;
    font-size: 9px; font-weight: 700;
    color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000;
    line-height: 1; pointer-events: none;
}

/* ── Block tooltip ── */
.blk-tooltip {
    position: fixed; z-index: 9999;
    background: #0d1625;
    border: 1px solid rgba(168,85,247,0.4);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    pointer-events: none;
    display: none;
    box-shadow: 0 6px 24px rgba(0,0,0,0.6);
    min-width: 120px;
    text-align: left;
}
.blk-tooltip span { display: block; }
.btt-ru    { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.btt-en    { font-size: 10px; color: var(--muted); margin-bottom: 4px; font-family: monospace; }
.btt-count { font-size: 11px; color: var(--accent); font-weight: 700; }

/* ── Litematic sidebar: mat-placeholder in editor ── */
.mat-placeholder {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg,rgba(168,85,247,.12),rgba(56,189,248,.08));
    border: 1px dashed rgba(168,85,247,.4); border-radius: 10px;
    padding: 10px 14px; margin: 6px 0; user-select: none;
}
.mp-icon  { font-size: 22px; flex-shrink: 0; }
.mp-info  { flex: 1; }
.mp-info strong { display: block; font-size: 13px; color: var(--text); }
.mp-info span   { font-size: 11px; color: var(--muted); }
.mp-remove {
    background: transparent; border: 1px solid var(--border); border-radius: 6px;
    color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 7px; flex-shrink: 0;
}
.mp-remove:hover { border-color: var(--danger); color: var(--danger); }
.btt-hint { font-size: 10px; color: var(--muted); margin-top: 3px; font-style: italic; }

/* ── Material Widget (post view) ── */
.mat-widget {
    background: var(--surf); border: 1px solid var(--border);
    border-radius: 14px; margin: 12px 0; overflow: hidden;
}
.mat-widget .spinner { margin: 24px auto; }
.mw-header {
    padding: 14px 16px 10px; border-bottom: 1px solid var(--border2);
    background: linear-gradient(135deg,rgba(168,85,247,.08),rgba(56,189,248,.04));
}
.mw-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mw-title   { font-size: 14px; font-weight: 800; }
.mw-summary { font-size: 12px; color: var(--muted); }
/* Segmented bar: green=gathered, orange=pending, gray=remaining (background) */
.mw-bar-seg {
    height: 6px; background: rgba(255,255,255,.08); border-radius: 3px;
    overflow: hidden; display: flex;
}
.mw-total-seg { margin-bottom: 6px; }
.mw-seg-green  { height: 100%; background: linear-gradient(90deg,#16a34a,#22c55e); transition: width .4s ease; flex-shrink: 0; }
.mw-seg-orange { height: 100%; background: linear-gradient(90deg,#b45309,#f59e0b); transition: width .4s ease; flex-shrink: 0; }
.mw-legend { display: flex; gap: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; margin-top: 5px; }
.mwl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; vertical-align: middle; flex-shrink: 0; }
.mwl-dot.green  { background: #22c55e; }
.mwl-dot.orange { background: #f59e0b; }
.mwl-dot.gray   { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); }

.mw-items { display: flex; flex-direction: column; }
.mw-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--border2); transition: background .1s;
}
.mw-item:last-child { border-bottom: none; }
.mw-item:hover  { background: rgba(255,255,255,.02); }
.mw-item.done   { opacity: .55; }
.mw-item-left   { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.mw-slot        { width: 38px; height: 38px; flex-shrink: 0; }
.mw-slot .blk-tex { width: 34px; height: 34px; }
.mw-item-info   { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mw-item-name   { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-item-sub    { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-item-right  { display: flex; align-items: center; gap: 8px; min-width: 160px; }
/* Old single-colour bar kept for fallback, new code uses mw-bar-seg */
.mw-bar-wrap    { flex: 1; height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; display: none; }
.mw-bar-fill    { height: 100%; background: linear-gradient(90deg,#16a34a,#22c55e); border-radius: 3px; transition: width .4s; }
/* New segmented bar inside items */
.mw-item-right .mw-bar-seg { flex: 1; height: 5px; }

.mw-done         { font-size: 11px; color: var(--success); font-weight: 700; white-space: nowrap; }
.mw-contrib-btn  {
    font-size: 11px; font-weight: 600; background: rgba(56,189,248,.1);
    border: 1px solid rgba(56,189,248,.3); color: #38bdf8; border-radius: 7px;
    padding: 3px 10px; cursor: pointer; white-space: nowrap;
}
.mw-contrib-btn:hover { background: rgba(56,189,248,.2); }
.mw-pending-badge { font-size: 11px; color: var(--warn); font-weight: 600; white-space: nowrap; }

/* Pending contribution rows inside each item (author view) */
.mw-pending-rows { width: 100%; padding: 6px 0 2px 48px; display: flex; flex-direction: column; gap: 4px; }
.mw-contrib-row  { display: flex; align-items: center; gap: 6px; font-size: 12px; background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.15); border-radius: 7px; padding: 5px 10px; }
.mcr-nick        { font-weight: 700; color: var(--text); flex-shrink: 0; }
.mcr-amount      { color: var(--success); font-weight: 700; flex-shrink: 0; }
.mcr-note        { color: var(--muted); font-size: 11px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcr-btn         { border-radius: 6px; border: 1px solid; padding: 2px 8px; font-size: 11px; font-weight: 700; cursor: pointer; background: transparent; }
.mcr-btn.approve { border-color: rgba(34,197,94,.4); color: var(--success); }
.mcr-btn.approve:hover { background: rgba(34,197,94,.12); }
.mcr-btn.reject  { border-color: rgba(239,68,68,.3); color: var(--danger); }
.mcr-btn.reject:hover  { background: rgba(239,68,68,.1); }

.mw-pending-notice { padding: 8px 16px; font-size: 12px; color: var(--warn); border-top: 1px solid var(--border2); }
.mw-login-hint     { padding: 8px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border2); text-align: center; }

/* Hoverable "remaining" count in sub-label */
.mw-remain-tip {
    cursor: help;
    border-bottom: 1px dotted rgba(148,163,184,.4);
    transition: color .1s, border-color .1s;
}
.mw-remain-tip:hover { color: var(--text); border-color: var(--accent2); }

/* Container size tooltip */
.ct-tooltip {
    position: fixed; z-index: 9999;
    background: #0d1625; border: 1px solid rgba(56,189,248,.3);
    border-radius: 10px; padding: 10px 14px;
    font-size: 12px; pointer-events: none; display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,.6); min-width: 190px;
}
.ctt-count { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.ctt-sep   { height: 1px; background: var(--border2); margin: 6px 0; }
.ctt-row   { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.ctt-row span   { color: var(--muted); }
.ctt-row strong { color: var(--accent2); font-weight: 700; }

/* ── Contribution modal ── */
.contrib-modal {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cm-inner {
    background: #0f172a; border: 1px solid rgba(56,189,248,.25);
    border-radius: 16px; width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.cm-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border2);
}
.cm-header span { font-size: 14px; font-weight: 700; }
.cm-close { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cm-close:hover { border-color: var(--danger); color: var(--danger); }
.cm-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.cm-block-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(56,189,248,.06); border: 1px solid rgba(56,189,248,.15); border-radius: 10px; }
.cm-block-img { width: 32px; height: 32px; image-rendering: pixelated; border-radius: 4px; }
.cm-block-name { font-weight: 700; font-size: 14px; }
.cm-remaining  { font-size: 12px; color: var(--muted); }
.cm-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.cm-field input, .cm-field textarea {
    width: 100%; background: rgba(30,41,59,.7); border: 1px solid var(--border);
    border-radius: 9px; padding: 9px 12px; color: var(--text); font-size: 14px;
    font-family: inherit; outline: none; transition: border-color .15s;
}
.cm-field input:focus, .cm-field textarea:focus { border-color: rgba(56,189,248,.4); }
.cm-field textarea { resize: none; min-height: 58px; }
.cm-err    { font-size: 12px; color: var(--danger); min-height: 16px; }
.cm-footer { display: flex; gap: 8px; }
.cm-submit { flex: 1; padding: 10px; background: linear-gradient(135deg,#0369a1,#38bdf8); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.cm-submit:hover:not(:disabled) { opacity: .88; }
.cm-submit:disabled { opacity: .45; cursor: not-allowed; }
.cm-cancel { padding: 10px 16px; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 14px; cursor: pointer; }
.cm-cancel:hover { border-color: var(--text); color: var(--text); }

/* ── Ban Banner ── */
.ban-banner {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(220,38,38,0.08));
    border: 2px solid rgba(239,68,68,0.4);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: banPulse 2s ease-in-out infinite;
}

@keyframes banPulse {
    0%, 100% { border-color: rgba(239,68,68,0.4); }
    50% { border-color: rgba(239,68,68,0.6); }
}

.ban-icon {
    font-size: 48px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(239,68,68,0.5));
}

.ban-content {
    flex: 1;
}

.ban-title {
    font-size: 20px;
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ban-text {
    font-size: 14px;
    color: #fca5a5;
    line-height: 1.5;
}

/* ── Mini Profile ── */
.mini-profile {
    position: fixed;
    z-index: 9500;
    width: 320px;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateY(-10px);
}

.mini-profile.show {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.mini-profile-banner {
    height: 80px;
    background: linear-gradient(135deg, #a855f7, #38bdf8);
    position: relative;
}

.mini-profile-banner.custom {
    background-size: cover;
    background-position: center;
}

.mini-profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 4px solid var(--surf);
    position: absolute;
    bottom: -38px;
    left: 20px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(168,85,247,0.3);
}

.mini-profile-avatar-placeholder {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 4px solid var(--surf);
    position: absolute;
    bottom: -38px;
    left: 20px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.mini-profile-body {
    padding: 48px 20px 20px;
}

.mini-profile-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.mini-profile-username {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 12px;
}

.mini-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    min-height: 32px;
}

.mini-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(168,85,247,0.15);
    color: #a855f7;
    border: 1px solid rgba(168,85,247,0.3);
    position: relative;
    cursor: help;
}

.mini-profile-badge-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,23,42,0.98);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.mini-profile-badge:hover .mini-profile-badge-tooltip {
    opacity: 1;
}

.mini-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
    background: rgba(15,23,42,0.4);
    border-radius: 12px;
    margin-bottom: 12px;
}

.mini-profile-stat {
    text-align: center;
}

.mini-profile-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.mini-profile-stat-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.mini-profile-joined {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

/* ── Mini-profile action buttons ── */
.mini-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.mini-profile-action-btn {
    display: block;
    width: 100%;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s, opacity 0.15s;
    border: 1px solid;
}

.mini-profile-action-btn.join {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(168, 85, 247, 0.15));
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}

.mini-profile-action-btn.join:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    text-decoration: none;
}

.mini-profile-action-btn.settings {
    background: rgba(148, 163, 184, 0.08);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

.mini-profile-action-btn.settings:hover {
    background: rgba(148, 163, 184, 0.14);
    color: #e2e8f0;
    transform: translateY(-1px);
    text-decoration: none;
}

.mini-profile-action-btn.logout {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
}

.mini-profile-action-btn.logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    transform: translateY(-1px);
}

/* Hover trigger для аватаров */
.fb-avatar, .fb-avatar-placeholder, .wn-avatar, .wn-avatar-ph, .pi-avatar, .pi-avatar-ph {
    cursor: pointer;
    position: relative;
}

/* ── Реакции ── */
.reactions-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(148,163,184,0.07);
}

/* Кнопка активной реакции (emoji + count) */
.rb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(15,23,42,0.6);
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .12s;
    color: var(--text);
    line-height: 1;
    user-select: none;
}
.rb span {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.rb:hover {
    background: rgba(168,85,247,0.13);
    border-color: rgba(168,85,247,0.4);
    transform: scale(1.07);
}
.rb.rb-mine {
    background: rgba(168,85,247,0.2);
    border-color: rgba(168,85,247,0.6);
}
.rb.rb-mine span { color: #c084fc; }

/* Кнопка «+» добавить реакцию */
.rb.rb-add {
    font-size: 16px;
    font-weight: 700;
    color: var(--muted);
    padding: 4px 9px;
    border-style: dashed;
    opacity: 0.7;
    transition: opacity .15s, background .15s, border-color .15s, transform .12s;
}
.rb.rb-add:hover {
    opacity: 1;
    color: var(--text);
    border-color: rgba(168,85,247,0.4);
    border-style: solid;
    transform: scale(1.07);
}

/* Пикер реакций */
.react-picker {
    position: fixed;
    z-index: 9600;
    background: rgba(15,23,42,0.98);
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 14px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    width: 228px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
    transition: opacity .15s, transform .15s;
    pointer-events: none;
}
.react-picker.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}
.rp-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s, transform .1s;
    border: 1px solid transparent;
}
.rp-btn:hover {
    background: rgba(168,85,247,0.15);
    border-color: rgba(168,85,247,0.3);
    transform: scale(1.2);
}

/* Плавающая кнопка баг-репорта */
.bug-report-fab {
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 8000;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(239,68,68,0.45);
    transition: transform .2s, box-shadow .2s;
    white-space: nowrap;
}
.bug-report-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(239,68,68,0.55); text-decoration: none; }


/* ── Category filters (for "Общее" category) ── */
.category-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.category-layout.with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.category-main-full {
    flex: 1;
}

.category-main-with-sidebar {
    min-width: 0;
}

/* Sidebar */
.category-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 70px;
}

.sidebar-card {
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s;
}

.sidebar-card:hover {
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.sidebar-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border2);
    background: rgba(168, 85, 247, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-card-header.collapsible {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.sidebar-card-header.collapsible:hover {
    background: rgba(168, 85, 247, 0.1);
}

.sidebar-card-icon {
    font-size: 16px;
}

.sidebar-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.collapse-icon {
    font-size: 12px;
    color: var(--muted);
    transition: transform 0.2s;
}

.sidebar-card-body {
    padding: 14px 16px;
}

/* Search in sidebar */
.sidebar-search-input {
    width: 100%;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 8px;
}

.sidebar-search-input:focus {
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* Select dropdown in sidebar */
.sidebar-select {
    width: 100%;
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    cursor: pointer;
}

.sidebar-select:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.sidebar-select option {
    background: #0f172a;
    color: var(--text);
    padding: 8px;
}

.sidebar-search-btn {
    width: 100%;
    padding: 8px 14px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.sidebar-search-btn:hover {
    opacity: 0.88;
}

.sidebar-clear-btn {
    width: 100%;
    padding: 6px 12px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.15s;
}

.sidebar-clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Tags in sidebar */
.sidebar-tag-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.sidebar-tag:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    transform: translateX(2px);
}

.sidebar-tag.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: var(--accent);
}

.tag-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
}

.sidebar-tag.active .tag-count {
    color: var(--accent);
    background: rgba(168, 85, 247, 0.2);
}

.sidebar-empty {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    padding: 12px 0;
}

/* Stats in sidebar */
.sidebar-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border2);
}

.sidebar-stat:last-child {
    border-bottom: none;
}

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

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

/* Hint card */
.sidebar-hint {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(56, 189, 248, 0.08));
    border-color: rgba(168, 85, 247, 0.2);
}

.sidebar-hint .sidebar-card-body {
    text-align: center;
}

/* Mobile responsive for sidebar */
@media (max-width: 900px) {
    .category-layout.with-sidebar {
        grid-template-columns: 1fr;
    }

    .category-sidebar {
        position: static;
        order: -1;
    }

    .sidebar-card {
        margin-bottom: 0;
    }
}


/* ========== НОВЫЕ СТИЛИ ДЛЯ ПРОЕКТОВ ========== */

/* Модальное окно кадрирования */
.crop-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    padding: 20px;
}

.crop-modal-inner {
    background: #0f172a;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crop-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 18px;
    font-weight: 700;
}

.crop-modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.crop-modal-close:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.crop-modal-body {
    padding: 20px;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.crop-container {
    width: 100%;
    max-width: 600px;
    height: 500px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* #crop-image must not have CSS constraints — Cropper.js manages its own sizing */
#crop-image { display: block; }

/* Theme the Cropper.js UI */
.cropper-modal { background-color: rgba(0, 0, 0, 0.6) !important; }
.cropper-view-box { outline: 2px solid #a855f7; outline-offset: -1px; }
.cropper-dashed { border-color: rgba(168, 85, 247, 0.45) !important; }
.cropper-point { background-color: #a855f7 !important; width: 8px !important; height: 8px !important; }
.cropper-line { background-color: rgba(168, 85, 247, 0.4) !important; }

.crop-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    justify-content: flex-end;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover {
    opacity: 0.88;
}

/* Просмотр проекта */
.project-view {
    max-width: 1200px;
    margin: 0 auto;
}

/* Square thumbnail in header band (replaces wide banner) */
.project-header-band {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}
.project-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(168, 85, 247, 0.25);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.15);
}
.project-header-text {
    flex: 1;
    min-width: 0;
}
.project-header-info { margin-bottom: 24px; }

.project-view-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.project-meta-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.project-category-badge,
.project-status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid;
}

.project-category-badge {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent);
    border-color: rgba(168, 85, 247, 0.3);
}

.project-closed-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.project-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--muted);
}

.project-content-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}
/* When materials strip is injected as first child */
.project-content-grid.has-materials {
    grid-template-columns: 210px 1fr 280px;
}

.project-main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.block-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.block-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.block-content {
    padding: 20px;
}

.project-description-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    margin: 0;
}

.project-coordinates-box {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #38bdf8;
    font-weight: 600;
}

.coord-inputs-row {
    display: flex;
    gap: 10px;
}

.coord-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.coord-axis-label {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.coord-input {
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.coord-input:focus {
    outline: none;
    border-color: #38bdf8;
}

.btn-download-litematic {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.15s;
}

.btn-download-litematic:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 18px;
}

.project-tags-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-tag {
    padding: 8px 14px;
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.project-sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
}

.btn-join-project-full {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-join-project-full:hover:not(:disabled) {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-join-project-full:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-edit-project {
    width: 100%;
    padding: 12px 20px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    color: #38bdf8;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-edit-project:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
}

.members-list-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.2) transparent;
}
.members-list-compact::-webkit-scrollbar { width: 4px; }
.members-list-compact::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 4px; }

.member-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: rgba(15, 23, 42, 0.35);
    border-radius: 7px;
    cursor: pointer;
    transition: background .12s;
}
.member-item .fb-avatar,
.member-item .fb-avatar-placeholder { width: 28px; height: 28px; font-size: 12px; border-width: 1px; box-shadow: none; flex-shrink: 0; }

.member-item:hover { background: rgba(15, 23, 42, 0.6); }

.member-nick {
    font-size: 12px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Форма создания проекта */
.new-project-form {
    max-width: 900px;
    margin: 0 auto;
}

.new-project-form h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.form-section {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--accent);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.project-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.project-select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    margin-left: 28px;
}

.bbcode-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-back {
    padding: 10px 20px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-back:hover {
    background: rgba(148, 163, 184, 0.2);
}

/* ══════════════════════════════════════════════════════
   Project view — layout & formatting overrides
   forum-block inside project context must be single-column
   (the base .forum-block uses a 150px|1fr author/content grid
   designed for forum posts — we override it here)
══════════════════════════════════════════════════════ */
.project-main-content .forum-block,
.project-sidebar-content .forum-block {
    display: flex;
    flex-direction: column;
}

/* Remove double-padding: block-content already pads 20px */
.project-main-content .forum-block .fb-content {
    padding: 0;
    font-size: 15px;
    line-height: 1.75;
    flex: none;
}

/* Uniform font sizes throughout project blocks */
.project-main-content .block-header h2,
.project-sidebar-content .block-header h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--text);
}
.project-view-title { font-size: 28px; font-weight: 800; }
.project-description-text { font-size: 14px; line-height: 1.75; color: #cbd5e1; }

/* approval badge (was missing) */
.project-approval-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── Project management controls (inline sidebar) ── */
.project-manage-rows { display: flex; flex-direction: column; gap: 0; }
.project-manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    font-size: 13px;
}
.project-manage-row:last-child { border-bottom: none; }
.project-manage-label { color: var(--muted); font-size: 12px; font-weight: 500; }

.project-status-select {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    padding: 5px 8px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}
.project-status-select:focus { border-color: var(--accent); }

/* Toggle switch */
.project-toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.project-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.project-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s;
}
.project-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.project-toggle input:checked + .project-toggle-slider { background: var(--accent); }
.project-toggle input:checked + .project-toggle-slider::before { transform: translateX(16px); }

/* ── Pending join applications ── */
.pending-applications-list { display: flex; flex-direction: column; gap: 8px; }
.pending-application {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 10px;
    transition: border-color .15s;
}
.pending-application:hover { border-color: rgba(168, 85, 247, 0.3); }
.pending-app-name {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-app-approve {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.btn-app-approve:hover { background: rgba(34, 197, 94, 0.22); }
.btn-app-approve:disabled { opacity: .4; cursor: default; }
.btn-app-reject {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.btn-app-reject:hover { background: rgba(239, 68, 68, 0.22); }
.btn-app-reject:disabled { opacity: .4; cursor: default; }

/* ── Project materials strip (left column) ── */
.proj-mat-strip {
    display: flex;
    flex-direction: column;
    background: var(--surf);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 80px);
}
.mat-strip-header {
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--border2);
    background: linear-gradient(135deg, rgba(168,85,247,.1), rgba(56,189,248,.04));
    flex-shrink: 0;
}
.mat-strip-title { font-size: 12px; font-weight: 800; color: var(--text); display: block; margin-bottom: 6px; }
.mat-strip-bar {
    height: 4px;
    background: rgba(255,255,255,.07);
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    margin-bottom: 4px;
}
.mat-strip-sub { font-size: 10px; color: var(--muted); }
.mat-strip-items {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.2) transparent;
}
.mat-strip-items::-webkit-scrollbar { width: 3px; }
.mat-strip-items::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 3px; }
.mat-strip-notice {
    padding: 8px 12px;
    font-size: 11px;
    color: var(--warn);
    border-top: 1px solid var(--border2);
    text-align: center;
    flex-shrink: 0;
}
.mat-strip-hint {
    padding: 8px 10px;
    font-size: 10px;
    color: var(--muted);
    border-top: 1px solid var(--border2);
    text-align: center;
    flex-shrink: 0;
    line-height: 1.4;
}

/* Strip items */
.mat-strip-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .1s;
}
.mat-strip-item:hover { background: rgba(255,255,255,.03); }
.mat-strip-item.done { opacity: .45; }
.msi-icon { flex-shrink: 0; }
.msi-tex { width: 28px; height: 28px; display: block; image-rendering: pixelated; }
.msi-info { flex: 1; min-width: 0; }
.msi-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.msi-bar { height: 3px; background: rgba(255,255,255,.07); border-radius: 2px; display: flex; overflow: hidden; margin: 3px 0; }
.msi-bar-fill { height: 100%; }
.msi-bar-fill.green  { background: #22c55e; transition: width .4s; }
.msi-bar-fill.orange { background: #f59e0b; transition: width .4s; }
.msi-sub { font-size: 10px; color: var(--muted); }
.msi-action { flex-shrink: 0; }
.msi-contrib-btn {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    border: 1px solid rgba(56,189,248,.3);
    background: rgba(56,189,248,.08);
    color: #38bdf8;
    cursor: pointer;
    transition: background .12s;
    white-space: nowrap;
}
.msi-contrib-btn:hover { background: rgba(56,189,248,.2); }
.msi-done-badge   { font-size: 11px; color: var(--success); font-weight: 700; }
.msi-pending-badge { font-size: 11px; color: var(--warn); }

/* Pending rows in strip (author view) */
.msi-pending-rows { margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.msi-pending-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 3px 6px;
    background: rgba(245,158,11,.06);
    border: 1px solid rgba(245,158,11,.15);
    border-radius: 6px;
}
.msi-pr-nick { font-weight: 700; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.msi-pr-amt  { color: var(--success); font-weight: 700; flex-shrink: 0; }

/* ── Project manage buttons ── */
.proj-manage-btn {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.proj-manage-btn:hover { background: rgba(56, 189, 248, 0.18); }
.proj-manage-btn-danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.07);
    color: #f87171;
}
.proj-manage-btn-danger:hover { background: rgba(239, 68, 68, 0.16); }

/* Project materials block in main content — full-width, no padding double-dip */
.proj-mat-block .mat-widget { border-radius: 0; border: none; }
.proj-mat-block .mat-widget.loaded { border-top: none; }

/* Адаптивность */
@media (max-width: 900px) {
    .project-content-grid,
    .project-content-grid.has-materials { grid-template-columns: 1fr; }
    .proj-mat-strip { position: static; max-height: 280px; }
    .project-body { grid-template-columns: 1fr; }
    .form-row     { grid-template-columns: 1fr; }
    .project-view-title { font-size: 22px; }
    .project-thumb { width: 80px; height: 80px; }
    .project-sidebar-content { position: static; }
}
