:root {
            --primary: #2ca26f; /* Синий акцент */
            --primary-hover: #28835D;
            --bg: #f1f5f9;
            --surface: #ffffff;
            --text: #1e293b;
            --muted: #64748b;
            --border: #e2e8f0;
            --dark: #344b57;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            color: var(--text);
            background-color: var(--bg);
            line-height: 1.6;
            word-break: break-word;
        }

        a { text-decoration: none; color: inherit; }
        ul { list-style: none; }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* Header */
        header {
            background: var(--surface);
            box-shadow: 0 1px 35px 0px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }
        header .btn {
            padding: 10px 15px;
            font-size: 14px;
        }
        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 70px;
        }
        header .nav-links li {
            margin: 0;
        }
        header .nav-links {
            padding-left: unset;
        }

        .logo {
            font-weight: 700;
            font-size: 1.25rem;
            color: var(--dark);
        }
        .logo span {
            border-left: 1px solid var(--dark);
            padding-left: 10px;
        }
        .logo span > span {
            display: block;
            font-size: 10px;
            text-align: right;
            margin-top: -15px;
            font-weight: normal;
        }
        .logo img {
            width: 20px;
            vertical-align: middle;
            margin-right: 10px;
            margin-top: -3px;
        }

        .nav-links { display: flex; gap: 24px; }
        .nav-links a:hover { color: var(--primary); }

        .auth-buttons button {
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            transition: 0.2s;
            font-size: 0.9rem;
        }
        .auth-buttons img {
            width: 19px;
            vertical-align: middle;
            margin-top: -4px;
            margin: 0 20px;    
        }
        .auth-buttons img:last-child {
            margin-right: 0;
        }
        .btn-login {
            border: 2px solid var(--border);
            background: transparent;
            color: var(--text);
        }
        .btn-login:hover { border-color: var(--muted); }
        .btn-register {
            background: var(--primary);
            color: white;
            border: 1px solid var(--primary);
        }
        .btn-register:hover { background: var(--primary-hover); }

        /* --- HERO SECTION --- */
        .hero {
            text-align: center;
            padding: 60px 0;
            background: url('../images/bg.jpg') center center no-repeat;
            background-size: cover;
            border-bottom: 2px solid var(--border);
            position: relative;
            overflow: hidden;
        }

        .hero h1 { 
            font-size: 1.5rem; 
            margin-bottom: 24px; 
            line-height: 1.1;
            position: relative;
            z-index: 1;
        }
        .hero span.highlight { color: var(--gold); }
        .hero p.subtitle { 
            font-size: 1.25rem; 
            max-width: 700px; 
            margin: 0 auto 40px; 
            color: var(--muted);
            position: relative;
            z-index: 1;
        }
        
        .badge-club {
            display: inline-block;
            background: #fff3e0;
            color: var(--gold);
            padding: 8px 20px;
            border-radius: 50px;
            font-weight: 700;
            font-size: 0.85rem;
            margin-bottom: 20px;
            border: 1px solid #fbd786;
            box-shadow: 0 4px 6px rgba(180, 83, 9, 0.1);
        }

        .hero p {
            color: var(--muted);
            font-size: 1.2rem;
            max-width: 600px;
            margin: 0 auto 32px;
        }

        .cta-group { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

        .btn, .bbcodes, .btn-green {
            padding: 14px 28px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            border: 2px solid var(--primary);
        }
        .btn:hover, .bbcodes:hover { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }
        .btn-primary, .bbcodes { background: var(--primary); color: white; }
        .btn-outline, .cancelchanges, .btn-green {
            background: transparent;
            border: 2px solid var(--border);
            color: var(--text);
        }
        .btn-outline:hover, .cancelchanges:hover, .btn-green { border-color: var(--muted); }

        .bbcodes, .btn-sm {
            padding: 7px 14px;
            font-size: 12px;
        }
        .badge-club {
            display: inline-block;
            background: #fff3e0;
            color: var(--gold);
            padding: 8px 20px;
            border-radius: 50px;
            font-weight: 700;
            font-size: 0.85rem;
            margin-bottom: 20px;
            border: 1px solid #fbd786;
            box-shadow: 0 4px 6px rgba(180, 83, 9, 0.1);
        }
        .tox-toolbar-overlord, .tox-editor-header { display:none!important; }
        .wseditor {
            border: 2px solid var(--border);
            border-radius: 5px !important;
        }
        .wseditor:active, .wseditor:focus, .wseditor:hover {
            border: 1px solid #109aceed!important;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1)!important;
        }
        .tox-tinymce {
            border: unset!important;
            border-radius: 5px!important;
        }
        .tox:not(.tox-tinymce-inline) .tox-editor-header {
            border:unset!important;
        }
        .tox .tox-statusbar {
            border-top: unset!important;
            background-color: var(--border)!important;
        }

        /* Chat Widget */
        .chat-widget {
            margin-top: 40px;
            padding: 24px;
            background: #f1f5f9;
            border-radius: 12px;
        }
        .widget-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 18px;
        }
        .msg-bubble {
            background: white;
            padding: 12px 16px;
            border-radius: 18px;
            max-width: 80%;
            margin-bottom: 12px;
            font-size: 0.95rem;
            box-shadow: 0 1px 2px rgba(0,0,0,0.03);
        }
        .msg-mine {
            align-self: flex-end;
            background: #eff6ff;
            border-left: 4px solid var(--primary);
        }
        .msg-other {
            align-self: flex-start;
            background: #f8fafc;
        }
        .input-area {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }
        .input-area input {
            flex: 1;
            padding: 12px;
            border: 2px solid var(--border);
            border-radius: 20px;
            outline: none;
        }
        .input-area button {
            padding: 12px 24px;
            border-radius: 20px;
            background: var(--primary);
            color: white;
            border: none;
            cursor: pointer;
        }

        /* Controls Section */
        .controls-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 32px;
            padding: 20px;
            background: white;
            border-radius: 16px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        
        .filters { display: flex; gap: 16px; align-items: center; }
        select {
            padding: 10px 16px;
            border-radius: 8px;
            border: 2px solid var(--border);
            font-size: 0.95rem;
            cursor: pointer;
            background: white;
        }

        /* View Toggle Button */
        .view-toggle-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 20px;
            background: #f8fafc;
            color: var(--text);
            border: 2px solid var(--border);
            border-radius: 50px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.3s;
        }
        .view-toggle-btn:hover { background: #eef2ff; border-color: var(--primary); }
        .view-toggle-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        .icon-grid, .icon-list { font-size: 1rem; }

        /* --- LAYOUT STYLES --- */

        /* Default: Horizontal List */
        .tasks-container, .content-block {
            display: grid;
            grid-template-columns: 1fr; /* Одна колонка по умолчанию для списка */
            gap: 20px;
            margin: 0 0 80px;
        }

        /* Task Card (Horizontal) */
        .task-card {
            background: var(--surface);
            padding: 20px;
            border-radius: 12px;
            border: 2px solid var(--border);
            display: flex;
            align-items: start;
            gap: 24px;
            transition: transform 0.3s, box-shadow 0.3s;
            cursor: pointer;
        }
        .task-card:hover {
            border: 2px solid var(--primary);
        }

        .task-info h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--dark); }
        .task-meta { display: flex; gap: 16px; margin-top: 8px; font-size: 0.85rem; color: var(--muted);     align-content: center;
    align-items: center; }
        .tag {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .tag-urgent { background: #fef2f2; color: #b91c1c; }
        .tag-design { background: #eff6ff; color: #2563eb; }
        .tag-dev { background: #ecfdf5; color: #059669; }

        .price-badge {
            font-weight: 700;
            color: var(--primary);
            font-size: 1.1rem;
        }

        /* CLASS FOR GRID VIEW (3 in a row) */
        .tasks-container.grid-view {
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        }

        /* Task Card in Grid Mode */
        .task-card.grid-mode {
            flex-direction: column;
            text-align: center;
            padding: 30px 20px;
            height: auto; /* Reset height */
        }
        .task-card.grid-mode .task-info {
            margin-top: 20px;
            width: 100%;
        }
        .task-info {
            width: 100%;
        }
        .task-card.grid-mode h3 {
            font-size: 1.25rem; /* Bigger title in grid */
        }
        .task-card.grid-mode .price-badge {
            font-size: 1.4rem;
            margin-top: 15px;
        }
        .task-card.grid-mode .tags-container {
            margin-top: 15px;
            display: flex;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* Mobile Responsiveness */
        @media (max-width: 768px) {
            .controls-bar { flex-direction: column; align-items: stretch; gap: 16px; }
            .filters { flex-wrap: wrap; justify-content: center; }
            
            /* На мобильных всегда сетка, но в 1 колонку */
            .tasks-container.grid-view {
                grid-template-columns: 1fr; 
            }
            .task-card.grid-mode {
                text-align: left; /* На мобильном снова выравниваем по левому краю для удобства */
                padding: 20px;
            }
        }

        /* Features Grid */
        .features {
            padding: 80px 0;
            background: var(--surface);
        }

        
        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 32px;
        }

        .card {
            padding: 32px;
            border: 2px solid var(--border);
            border-radius: 12px;
            transition: 0.3s;
        }
        .card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
        .icon {
            width: 48px;
            height: 48px;
            background: #eff6ff;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            margin-bottom: 16px;
            font-size: 1.5rem;
        }
        .card h3 { margin-bottom: 8px; }
        .card p { color: var(--muted); }

        /* Roles Split */
        .roles { padding: 80px 0; }
        .roles-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            align-items: center;
            margin: 0 0 80px;
        }

        .role-box {
            padding: 40px;
            border-radius: 16px;
            border: 2px solid var(--border);
        }
        .role-box ul li {
            list-style: disc;
        }
        .role-customer { background: rgba(37, 99, 235, 0.05); border-color: rgba(37, 99, 235, 0.15); }
        .role-freelancer { background: rgba(18, 197, 233, 0.05); border-color: rgba(18, 197, 233, 0.15); }

        .role-title { font-size: 1.5rem; margin-bottom: 16px; }
        .role-desc { color: var(--muted); margin-bottom: 24px; }

        /* tasks */
        /* Breadcrumbs */
        .breadcrumbs {
            color: var(--muted);
            font-size: 0.85rem;
            margin: 28px 0;
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }
        .breadcrumbs span { color: #94a3b8; }

        /* Layout */
        .task-layout {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 40px;
        }
        @media (max-width: 900px) {
            .task-layout { display:block; }
            .sidebar { order: -1; margin-bottom: 30px; }
        }

        /* Task Header */
        .task-header {
            background: var(--surface);
            padding: 20px;
            border-radius: 12px;
            border: 2px solid var(--border);
            margin-bottom: 24px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
        }
        .tags-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 16px;
        }
        .tag {
            background: #eff6ff;
            color: var(--primary);
            padding: 6px 12px;
            border-radius: 99px;
            font-size: 0.8rem;
            font-weight: 600;
        }
        h1.task-title {
            font-size: 1.3rem;
            margin-bottom: 15px;
            color: var(--gray-dark);
        }
        .task-meta {
            color: var(--muted);
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--border);
        }
        .task-meta strong { color: var(--text); }

        /* Blocks */
        .section-block {
            background: var(--surface);
            padding: 20px;
            border-radius: 12px;
            border: 2px solid var(--border);
            margin-bottom: 24px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        }
        .section-title {
            font-size: 1.25rem;
            margin-bottom: 16px;
            font-weight: 700;
            color: var(--gray-dark);
            padding-bottom: 12px;
        }

        /* Checklist */
        .checklist-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 14px;
            padding: 12px 0;
            border-bottom: 1px dashed var(--border);
        }
        .checklist-item:last-child { border-bottom: none; }
        .checkbox {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin-top: 2px;
        }
        .checkbox.checked {
            background: var(--success);
            border-color: var(--success);
        }
        .checkbox.checked::after {
            content: '✓';
            color: white;
            font-weight: bold;
            font-size: 14px;
        }
        .item-text {
            color: var(--text);
            font-size: 1rem;
            line-height: 1.5;
        }

        /* Timeline */
        .timeline {
            position: relative;
            border-left: 2px solid var(--border);
            padding-left: 50px;
        }
        .timeline-item {
            position: relative;
            margin-bottom: 24px;
        }
        .time-dot {
            position: absolute;
            left: -30px;
            top: 2px;
            width: 14px;
            height: 14px;
            background: var(--border);
            border-radius: 50%;
        }
        .time-dot.done {
            background: var(--success);
            box-shadow: 0 0 0 3px #dcfce7;
        }
        .time-info {
            font-weight: 600;
            color: var(--muted);
            font-size: 0.85rem;
            margin-bottom: 4px;
            display: block;
        }
        .time-desc {
            color: var(--text);
        }

        /* Files */
        .file-list { display: flex; flex-direction: column; gap: 10px; }
        .file-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: #f8fafc;
            border: 2px solid var(--border);
            border-radius: 8px;
        }
        .file-icon {
            width: 40px;
            height: 40px;
            background: #cbd5e1;
            color: white;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            flex-shrink: 0;
        }
        .file-details span { display: block; }
        .file-name {
            font-weight: 600;
            color: var(--text);
        }
        .file-size {
            font-size: 0.8rem;
            color: var(--muted);
        }
        .file-download {
            color: var(--primary);
            font-weight: 600;
            white-space: nowrap;
        }

        /* Sidebar */
        .sidebar-card {
            background: var(--surface);
            padding: 24px;
            border-radius: 12px;
            border: 2px solid var(--border);
            top: 100px;
            z-index: 99;
        }
        .price-large {
            font-size: 1.8rem;
            font-weight: 800;
            color: var(--success);
            display: block;
            margin-bottom: 8px;
        }
        .deadline-info {
            color: var(--warning);
            font-weight: 600;
            display: inline-block;
            margin-bottom: 24px;
            padding: 6px 12px;
            background: #fff3cd;
            border-radius: 6px;
        }
        .client-preview {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 24px;
            padding-bottom: 24px;
            border-bottom: 1px solid var(--border);
        }
        .avatar-sm {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #475569;
            font-weight: bold;
        }
        .client-info h4 { margin-bottom: 4px; }
        .rating-stars { color: #fbbf24; }
        .action-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

        /* Hero профиля */
        .profile-hero {
            background: #fff;
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 40px;
            display: grid;
            grid-template-columns: 1fr 3fr;
            gap: 20px;
            align-items: start;
            border: 2px solid var(--border);
        }
        .status_online {
            display: block;
            margin: 20px 0;
            font-size: 12px;
            color: var(--primary);
        }

        .profile-clubman {
            background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
        }
        .avatar-wrapper {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background: #cbd5e1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            color: #475569;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
        .status-badge {
            position: absolute;
            bottom: 0;
            right: 0;
            background: var(--success);
            color: white;
            padding: 4px 8px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: bold;
        }

        .profile-info h1 { font-size: 1.5rem; margin-bottom: 8px; }
        .profile-role { color: var(--muted); font-size: 1.1rem; margin-bottom: 16px; }
        .profile-stats { display: flex; gap: 10px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }

        /* Навыки */
        .skills-section { margin-bottom: 40px; }
        .tags-grid { display: flex; flex-wrap: wrap; gap: 10px; }
        .tags-grid > span, .tags-grid > div, .tags-grid > a {
            background: #eff6ff;
            color: var(--primary);
            border: 2px solid var(--border);
            padding: 6px 12px;
            border-radius: 99px;
            font-size: 0.85rem;
            font-weight: 600;
        }

        /* Портфолио */
        .portfolio-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 24px;
        }
        .project-card {
            border: 2px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
            background: white;
        }
        .card-img { height: 180px; background: #e2e8f0; width: 100%; display: block; }
        .card-body { padding: 16px; }
        .card-title { font-weight: 700; margin-bottom: 8px; }
        .card-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
        .card-price { color: var(--orange); font-weight: 700; }

        /* Сайдбар действий (для заказчика) */
        .action-sidebar {
            position: sticky;
            top: 100px;
            height: fit-content;
            background: var(--surface);
            padding: 24px;
            border-radius: 12px;
            border: 2px solid var(--border);
            box-shadow: 0 4px 6px rgba(0,0,0,0.02);
        }
        .rating-display { color: #fbbf24; margin-bottom: 16px; font-size: 1.2rem; }

        @media (max-width: 900px) {
            .profile-hero { grid-template-columns: 1fr; }
            .avatar-wrapper { margin: 0 auto 20px; }
            .action-sidebar { position: static; margin-top: 40px; }
        }

        /* Hero профиля заказчика */
        
        .company-avatar {
            width: 150px;
            height: 150px;
            border-radius: 12px; /* Квадратный аватар для компаний */
            background: #f1f5f9;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            color: #475569;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
        .verified-badge {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background: var(--success);
            color: white;
            padding: 4px 8px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: bold;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .client-info h1 { font-size: 1.5rem; margin-bottom: 8px; }
        .client-role { color: var(--muted); font-size: 1.1rem; margin-bottom: 16px; }
        .client-stats { display: flex; gap: 32px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }

        /* Табы (Переключатели) */
        .tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 24px;
            padding-bottom: 8px;
            flex-direction: row;
            flex-wrap: wrap;
        }
        .tab-btn {
            padding: 8px 16px;
            background: transparent;
            border: 2px solid var(--border);
            cursor: pointer;
            color: var(--muted);
            font-weight: 500;
            border-radius: 8px;
        }
        .tab-btn.active, .tab-btn:hover {
            color: var(--primary);
            background: rgba(37, 99, 235, 0.05);
        }

        /* Сетка проектов */
        .projects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 24px;
        }
        .project-card {
            border: 2px solid var(--border);
            border-radius: 12px;
            padding: 20px;
            background: white;
        }
        .card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
        .status-tag {
            padding: 4px 8px;
            border-radius: 99px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
        }
        .status-new { background: #eff6ff; color: var(--primary); }
        .status-done { background: #dcfce7; color: var(--success); }
        .status-in-progress { background: #fef3c8; color: var(--warning); }
        
        .card-title { font-weight: 700; margin-bottom: 8px; font-size: 1.1rem; }
        .card-budget { color: var(--muted); margin-bottom: 16px; font-size: 0.95rem; }
        .card-desc { color: #475569; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

        /* Базовые стили для табов (как у тебя) */
        .tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 24px;
            padding-bottom: 8px;
            flex-direction: row;
            flex-wrap: wrap;
        }

        .tab-btn {
            padding: 8px 16px;
            background: transparent;
            border: 2px solid var(--border);
            cursor: pointer;
            color: var(--muted);
            font-weight: 500;
            border-radius: 8px;
        }

        .tab-btn.active, .tab-btn:hover {
            color: var(--primary);
            background: rgba(44, 162, 111, 0.05);
        }

        /* Кнопка «Фильтр» на мобильных */
        .tabs-toggle {
            display: none; /* скрыто по умолчанию */
            width: 100%;
            padding: 12px;
            text-align: left;
            background: var(--surface);
            border: 2px solid var(--border);
            color: var(--text);
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .tabs-toggle:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .tabs-toggle[aria-expanded="true"] {
            border-color: var(--primary);
            color: var(--primary);
            box-shadow: 0 4px 12px rgba(44, 162, 111, 0.15);
        }

        /* Мобильная логика */
        @media (max-width: 768px) {
            .tabs-toggle {
                display: block;
            }

            .tabs {
                display: flex;
                flex-direction: column;
                gap: 10px;
                max-height: 0;
                overflow: hidden;
                opacity: 0;
                transition: max-height 0.35s cubic-bezier(0.25, 1, 0.5, 1),
                            opacity 0.35s ease;
                padding: 0;
                margin: 12px 0 0;
            }

            /* Состояние «открыто» */
            .tabs[data-open="true"] {
                max-height: 800px; /* достаточно большое значение */
                opacity: 1;
            }
        }


        /* Сайдбар действий */
        .action-sidebar {
            position: sticky;
            top: 100px;
            height: fit-content;
            background: var(--surface);
            padding: 24px;
            border-radius: 12px;
            border: 2px solid var(--border);
        }
        .trust-level {
            display: inline-block;
            padding: 6px 12px;
            background: #d1fae5;
            color: var(--success);
            border-radius: 99px;
            font-weight: 700;
            margin-bottom: 24px;
            font-size: 0.9rem;
        }

        @media (max-width: 900px) {
            .company-avatar { margin: 0 auto 20px; }
            .action-sidebar { position: static; margin-top: 40px; width: 100%; }
        }

        /* Stats Bar (Top Summary) */
        .stats-bar {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 40px;
        }
        .stat-card {
            background: var(--surface);
            padding: 24px;
            border-radius: 12px;
            border: 2px solid var(--border);
            text-align: center;
        }
        .stat-value {
            font-size: 2.5rem; font-weight: 800; color: var(--primary);
            display: block; margin-bottom: 8px;
        }
        .stat-label { color: var(--muted); font-size: 0.95rem; }

        /* Filters */
        .filters {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--border);
        }
        .filter-btn {
            padding: 10px 20px;
            background: #f1f5f9;
            color: var(--text);
            border: none;
            border-radius: 50px;
            cursor: pointer;
            font-weight: 500;
            transition: 0.2s;
        }
        .filter-btn.active, .filter-btn:hover {
            background: var(--primary);
            color: white;
        }

        /* Reviews Grid */
        .reviews-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
            gap: 24px;
        }

        /* Review Card */
        .review-card {
            background: var(--surface);
            padding: 24px;
            border-radius: 12px;
            border: 2px solid var(--border);
            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
            position: relative;
        }
        .review-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 16px;
        }
        .reviewer-info h4 { margin-bottom: 4px; font-size: 1rem; }
        .reviewer-role { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
        
        .stars { color: var(--star-color); font-size: 1rem; margin-right: 8px; }
        .rating-num { font-weight: bold; color: var(--text); font-size: 0.9rem; }

        .task-ref {
            display: inline-block;
            background: #eff6ff;
            color: var(--primary);
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-top: 8px;
        }
        .task-grid {
            display: grid;
            grid-auto-flow: row;
            gap: 20px;   
        }

        .review-text {
            color: var(--muted);
            margin: 16px 0;
            line-height: 1.5;
            font-size: 0.95rem;
        }
        
        .review-date {
            font-size: 0.75rem;
            color: #94a3b8;
            text-align: right;
            margin-top: auto;
        }

        /* Add Review Form (Sticky or Section) */
        .add-review-section {
            background: var(--surface);
            padding: 32px;
            border-radius: 12px;
            border: 2px dashed var(--border);
            margin-bottom: 40px;
            text-align: center;
        }
        .form-group { margin-bottom: 16px; text-align: left; }
        .form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
        .form-control {
            width: 100%;
            padding: 12px;
            border: 2px solid var(--border);
            border-radius: 8px;
            outline: none;
        }
        .form-control:focus { border-color: var(--primary); }
        
        .rating-input {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 20px;
        }
        .rating-star {
            font-size: 1.5rem; cursor: pointer; color: #cbd5e1; transition: 0.2s;
        }
        .rating-star.active, .rating-star:hover { color: var(--star-color); }

        @media (max-width: 768px) {
            .stats-bar { grid-template-columns: 1fr 1fr; }
            .review-header { flex-direction: column; align-items: flex-start; gap: 10px; }
        }

        @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

        /* Cards Grid */
        .services-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 32px;
        }

        /* Service Card */
        .service-card {
            background: var(--surface);
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 32px;
            position: relative;
            overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .service-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        
        .badge-premium {
            position: absolute;
            top: 16px;
            right: 16px;
            background: #fff;
            border: 2px solid var(--border);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--premium-gold);
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
        }
        
        .card-icon {
            width: 50px; height: 50px;
            background: #eff6ff;
            color: var(--primary);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-bottom: 20px;
        }

        .card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; color: var(--gray-dark, #1e293b); }
        .card-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; line-height: 1.4; }

        .price-block {
            display: flex;
            flex-direction: column;
            gap: 16px;
            margin-top: auto; /* Прижимает кнопки вниз */
        }

        .pricing-options {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
            margin-bottom: 16px;
        }
        .price-option {
            border: 2px solid var(--border);
            padding: 8px;
            text-align: center;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
            color: var(--muted);
        }
        .price-option.selected {
            border-color: var(--primary);
            background: #eff6ff;
            color: var(--primary);
        }
        .price-value { font-weight: bold; color: var(--text); display: block; margin-top: 4px; }

        .btn-buy {
            width: 100%;
            padding: 14px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }
        .btn-buy:hover { background: var(--primary-hover); }

        /* Special Highlight for Top Service */
        .highlight-card { border: 2px solid var(--primary); }
        .highlight-card .badge-premium { background: var(--primary); color: white; }

        @media (max-width: 768px) {
            .tabs-switcher { flex-wrap: wrap; justify-content: center;}
            .pricing-options { grid-template-columns: 1fr; }
            .price-option { width: 100%; }
        }

        /* Sections */
        .form-section { margin-bottom: 32px; border-bottom: 1px solid #f1f5f9; padding-bottom: 24px; }
        
        .required-dot { color: var(--danger); font-weight: bold; }

        /* Inputs & Textareas */
        .form-group { margin-bottom: 16px; }
        label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text); }
        .input-control, textarea {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: #fff;
            font-size: 1rem;
            transition: all 0.2s;
            outline: none;
        }
        .input-control:focus, textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }
        textarea { resize: vertical; min-height: 120px; }

        /* Grid inputs (Price + Deadline) */
        .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

        /* Tags / Skills selector */
        .tags-container {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            min-height: 44px;
            padding: 6px 12px;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: #f8fafc;
        }
        .tag-chip {
            background: #eff6ff;
            color: var(--primary);
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .remove-tag { cursor: pointer; opacity: 0.6; }
        .remove-tag:hover { opacity: 1; color: var(--danger); }

        /* File Upload */
        .file-upload-zone {
            border: 2px dashed var(--border);
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: 0.2s;
        }
        .file-upload-zone:hover { border-color: var(--primary); background: #f0f7ff; }
        .upload-icon { font-size: 2rem; margin-bottom: 12px; display: block; }
        .upload-text { color: var(--muted); }
        .upload-hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

        .btn-cancel {
            background: transparent;
            color: var(--muted);
            border: 2px solid var(--border);
        }
        .btn-cancel:hover { background: #f1f5f9; border-color: var(--border); }

        @media (max-width: 640px) {
            .form-wrapper { padding: 20px; }
            .grid-2 { grid-template-columns: 1fr; }
        }

        .stat-item strong { display: block; color: var(--text); font-size: 1.2rem; }
        .stat-item span { color: var(--muted); font-size: 0.9rem; }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 32px;
            margin-bottom: 60px;
        }
        .feature-card {
            background: var(--surface);
            padding: 32px;
            border-radius: 16px;
            border: 2px solid var(--border);
            transition: transform 0.3s, box-shadow 0.3s;
            position: relative;
            overflow: hidden;
        }
        .feature-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
            border-color: var(--gold);
        }
        .card-icon-wrapper {
            width: 56px; height: 56px;
            background: #eff6ff;
            color: var(--primary);
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-bottom: 20px;
            flex-shrink: 0;
        }
        .feature-card h3 { margin-bottom: 12px; font-size: 1.15rem; font-weight: 700; }
        .feature-card p { color: var(--muted); font-size: 0.95rem; }
        .tag-premium {
            position: absolute; top: 16px; right: 16px;
            background: var(--gold-bg, #fff7ed);
            color: var(--gold);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
        }

        /* --- CONDITIONS --- */
        .conditions-section {
            background: var(--surface);
            padding: 40px;
            border-radius: 16px;
            margin-bottom: 60px;
            border: 2px dashed var(--border);
        }
        .section-title-alt {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 24px;
            color: var(--dark);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .check-list { list-style: none; }
        .check-item {
            display: flex;
            align-items: flex-start;
            gap: 16px;
            margin-bottom: 16px;
            padding-top: 12px;
            border-top: 1px solid #f1f5f9;
        }
        .check-icon { color: var(--success); font-weight: bold; margin-top: 2px; }

        /* --- MEMBERS SHOWCASE --- */
        .members-section {
            margin-bottom: 80px;
        }
        .members-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 24px;
        }
        .member-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            border: 2px solid var(--border);
            text-align: center;
        }
        .avatar-placeholder {
            width: 80px; height: 80px;
            background: #e0e7ff;
            color: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.5rem;
            margin: 0 auto 16px;
            border: 3px solid white;
        }
        .member-name { font-weight: 700; margin-bottom: 4px; display: block; }
        .member-role { color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }
        .member-stats {
            display: flex;
            justify-content: center;
            gap: 12px;
            font-size: 0.8rem;
            color: var(--muted);
        }
        .stat-dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; display: inline-block; }

        /* --- JOIN BLOCK --- */
        .join-block {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            max-width: 520px;
            margin: 0 auto;
            padding: 40px;
            background: white;
            border-radius: 24px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.05);
            border: 2px solid var(--border);
        }
        .price-display {
            font-size: 3.5rem;
            font-weight: 800;
            color: var(--gold);
            line-height: 1;
            margin: 20px 0 10px;
        }
        .price-period {
            font-size: 1rem;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 30px;
        }
        .roi-note {
            background: #fef3c7;
            color: #92400e;
            padding: 12px 20px;
            border-radius: 8px;
            font-weight: 600;
            margin-bottom: 30px;
            display: inline-block;
        }
        .btn-join {
            width: 100%;
            padding: 22px;
            border: none;
            border-radius: 12px;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 10px 15px -3px rgba(180, 83, 9, 0.4);
            transition: all 0.3s;
            text-transform: uppercase;
        }

        .btn-join:hover {
            transform: scale(1.02);
        }
        .benefits-note { margin-top: 20px; font-size: 0.9rem; color: var(--muted); }

        @media (max-width: 768px) {
            .hero h1 { font-size: 1.5rem; }
            .stats-bar { flex-direction: column; gap: 20px; }
            .join-block { padding: 20px; }
        }

        /* Hero Section */
        .hero-rating {
            text-align: center;
            margin-bottom: 60px;
            padding: 40px;
            background: white;
            border-radius: 24px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
        }
        .badge-top {
            display: inline-block;
            background: #eff6ff;
            color: var(--primary);
            padding: 6px 16px;
            border-radius: 50px;
            font-weight: 700;
            font-size: 0.85rem;
            margin-bottom: 16px;
            border: 1px solid #dbeafe;
        }
        .hero-rating h1 { font-size: 1.5rem; margin-bottom: 20px; line-height: 1.2; }
        .hero-rating p { font-size: 1.1rem; max-width: 600px; margin: 0 auto; color: var(--muted); }

        /* Controls (Filters & Sort) */
        .controls {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
            margin-bottom: 40px;
            align-items: center;
        }
        .filter-group { display: flex; align-items: center; gap: 12px; }
        select, .sort-btn {
            padding: 10px 16px;
            border-radius: 8px;
            border: 2px solid var(--border);
            font-size: 0.95rem;
            cursor: pointer;
            background: white;
        }
        select:focus, .sort-btn:focus { outline: none; border-color: var(--primary); }
        
        .sort-group { margin-left: auto; }
        .sort-label { color: var(--muted); margin-right: 8px; }

        /* Grid Layout */
        .freelancers-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 32px;
        }

        /* Freelancer Card */
        .f-card {
            background: var(--surface);
            border-radius: 16px;
            overflow: hidden;
            border: 2px solid var(--border);
            transition: transform 0.3s, box-shadow 0.3s;
            position: relative;
        }
        .f-card:hover {
            border: 2px solid var(--primary);
        }

        .card-header {
            height: 140px;
            background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%);
            position: relative;
            display: flex;
            align-items: flex-end;
            padding: 16px;
        }
        .avatar-big {
            width: 84px; height: 84px;
            background: white;
            border-radius: 50%;
            border: 4px solid white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 2rem;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            z-index: 2;
            margin-bottom: -42px; /* Наезд аватара на заголовок */
        }
        
        .club-badge {
            position: absolute; top: 12px; right: 16px;
            background: #fff3e0; color: var(--gold);
            padding: 4px 12px; border-radius: 20px;
            font-size: 0.75rem; font-weight: 700;
            border: 1px solid #fbd786;
            display: none; /* Скрыт по умолчанию */
        }
        .is-club .club-badge { display: block; } /* Показываем если класс есть */

        .card-body { padding: 64px 20px 20px; text-align: center; }
        .f-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; color: var(--dark); }
        .f-role { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; display: block; }
        
        .stats-row { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid #f1f5f9; padding-bottom: 20px; }
        .stat-item strong { display: block; color: var(--dark); font-size: 14px; }
        .stat-item span { color: var(--muted); font-size: 0.8rem; }

        .price-block {
            margin-bottom: 24px;
            text-align: center;
        }
        .price-val {
            font-size: 1.5rem; font-weight: 700; color: var(--primary);
        }
        .price-unit { color: var(--muted); font-size: 0.9rem; }

        .cta-btn {
            width: 100%;
            padding: 14px;
            background: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: 0.3s;
        }
        .cta-btn:hover { background: var(--primary); color: white; }


        @media (max-width: 768px) {
            .hero-rating h1 { font-size: 1.5rem; }
            .controls { flex-direction: column; align-items: stretch; }
            .sort-group { margin-left: 0; margin-top: 16px; }
            .stats-row { flex-direction: column; gap: 12px; }
        }

        .inform {
            text-align: center;
            max-width: 450px;
            width: 100%;
            background: var(--surface);
            border-radius: 16px;
            border: 2px solid var(--border);
            padding: 60px 20px;
        }

        /* Иконка-статус */
        .inform .status-icon {
            width: 80px;
            height: 80px;
            background: #d1fae5; /* Светло-зеленый фон */
            color: var(--success);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            margin: 0 auto 24px auto;
            border: 4px solid #86efac;
        }

        .inform h1 {
            color: var(--dark);
            font-size: 1.5rem;
            margin-bottom: 12px;
        }

        .inform p.message {
            color: var(--muted);
            margin-bottom: 40px;
            font-size: 1rem;
        }

        .inform button.action-btn {
            width: 100%;
            padding: 14px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }
        .inform button.action-btn:hover { background-color: #1d4ed8; }

        .inform .back-link {
            margin-top: 20px;
            font-size: 0.9rem;
            color: var(--muted);
        }
        .inform .back-link a { color: var(--primary); text-decoration: underline; }

        /* static */
        /* --- СЕТКА (МЕНЮ + КОНТЕНТ) --- */
        .layout-grid {
            display: grid;
            grid-template-columns: 280px 1fr;
            gap: 40px;
        }

        @media (max-width: 768px) {
            .layout-grid { grid-template-columns: 1fr; }
            h1 { font-size: 1.3rem; }
        }

        /* --- МЕНЮ НАВИГАЦИИ --- */
        .toc-menu {
            position: sticky;
            top: 20px;
            height: fit-content;
            background: var(--surface);
            padding: 20px;
            border-radius: 12px;
            border: 2px solid var(--border);
        }

        .toc-list { list-style: none; }
        .toc-item { margin-bottom: 8px; }
        .toc-link {
            color: var(--muted);
            text-decoration: none;
            display: block;
            padding: 8px 0;
            transition: color 0.2s;
        }
        .toc-link:hover, .toc-link.active { color: var(--primary); font-weight: 600; }

        /* --- ОСНОВНОЙ КОНТЕНТ --- */
        .content-wrapper {
            background: var(--surface);
            padding: 40px;
            border-radius: 16px;
            border: 2px solid var(--border);
        }

        h2 { 
            color: var(--dark); 
            font-size: 1.8rem; 
            padding-bottom: 10px;
        }

        p { margin-bottom: 16px;color: #334155;font-weight: normal;font-size: 14px; }
        p:last-child, .section-block p:last-child { margin-bottom:0!important; }
        strong { color: var(--dark); }
        
        ul, ol { padding-left: 20px; }
        li { margin-bottom: 8px; }

        /* --- АКЦЕНТНЫЕ БЛОКИ --- */
        .note-box {
            background: var(--alert-bg);
            border-left: 5px solid var(--alert-text);
            padding: 20px;
            margin: 30px 0;
            border-radius: 0 8px 8px 0;
        }
        .note-box h4 { color: var(--alert-text); margin-bottom: 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }

        .success-box {
            background: var(--success-bg);
            border-left: 5px solid var(--success-text);
            padding: 20px;
            margin: 30px 0;
            border-radius: 0 8px 8px 0;
        }
        .success-box h4 { color: var(--success-text); margin-bottom: 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }

        code {
            background: #f8fafc;
            padding: 2px 6px;
            border-radius: 4px;
            font-family: monospace;
            color: #d63384;
        }

        hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

        /* Blog */
        /* --- FILTERS (ТАБЫ) --- */
        .filter-bar {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin-bottom: 40px;
            flex-wrap: wrap;
        }
        .filter-btn {
            padding: 10px 20px;
            border: 2px solid var(--border);
            background: white;
            color: var(--muted);
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.9rem;
        }
        .filter-btn:hover { background: var(--border); }
        .filter-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        /* --- GRID LAYOUT --- */
        .articles-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 3fr));
            gap: 30px;
        }

        /* --- CARD STYLES --- */
        .article-card {
            background: var(--surface);
            border-radius: 16px;
            overflow: hidden;
            border: 2px solid var(--border);
            transition: transform 0.3s, box-shadow 0.3s;
            display: flex;
            flex-direction: column;
        }
        .article-card:hover {
            transform: translateY(-5px);
        }

        .card-image {
            height: 200px;
            background-color: #ddd;
            position: relative;
            overflow: hidden;
        }
        /* Заглушки изображений (градиент) */
        .img-freelance { background: linear-gradient(135deg, #fef3c7, #fbbf24); }
        .img-client { background: linear-gradient(135deg, #ecfdf5, #0ea5e9); }
        .img-news { background: linear-gradient(135deg, #f3f4f6, #94a3b8); }

        .category-badge {
            position: absolute;
            top: 12px;
            left: 12px;
            background: rgba(255, 255, 255, 0.9);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
        }
        
        .badge-freelance { color: #92400e; background: #fffded; }
        .badge-client { color: #046655; background: #dcfce7; }
        .badge-news { color: #334155; background: #e2e8f0; }

        .card-body { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
        
        .date-tag {
            color: var(--muted);
            font-size: 0.85rem;
            margin-bottom: 12px;
            display: block;
        }

        .card-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--dark);
            margin-bottom: 12px;
            line-height: 1.3;
        }

        .card-excerpt {
            color: #475569;
            font-size: 0.95rem;
            margin-bottom: 24px;
            flex-grow: 1;
        }

        .read-more {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .read-more:hover { text-decoration: underline; }

        /* Утилиты для JS фильтрации */
        .hide { display: none !important; }

        .meta-info {
            display: flex;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
            color: var(--muted);
            font-size: 0.95rem;
            margin-top: 20px;
        }
        .author-block { display: flex; align-items: center; gap: 12px; }
        .avatar {
            width: 32px;
            height: 32px;
            background: #ddd;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: #555;
        }

        /* --- MAIN CONTENT --- */
        article.post-content {
            background: var(--surface);
            padding: 40px;
            border-radius: 16px;
            border: 2px solid var(--border);
            margin-bottom: 60px;
        }

        article p { margin-bottom: 24px; color: #334155; }
        article p:last-child { margin-bottom:0!important; }
        
        article h2 { 
            color: var(--dark); 
            font-size: 1.75rem; 
            margin-top: 48px; 
            margin-bottom: 20px; 
            border-left: 5px solid var(--primary);
            padding-left: 15px;
        }
        article h3 { color: var(--dark); font-size: 1.3rem; margin-bottom: 16px; }

        article ul, ol { padding-left: 24px; }
        article li { margin-bottom: 12px; }

        article strong { color: var(--dark); }
        article em { color: var(--muted); }

        article code {
            background: #f1f5f9;
            padding: 2px 6px;
            border-radius: 4px;
            font-family: monospace;
            color: #d63384;
        }

        article img {
            max-width: 100%;
            height: auto;
            border-radius: 8px;
            margin: 30px 0;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }

        /* --- SPECIAL BLOCKS --- */
        .highlight-box {
            background: var(--accent);
            border-left: 5px solid #b45309;
            padding: 20px;
            margin: 30px 0;
            border-radius: 0 8px 8px 0;
        }
        .highlight-box h4 { color: #92400e; margin-bottom: 10px; font-size: 1rem; }

        blockquote {
            border-left: 4px solid var(--primary);
            margin: 30px 0;
            padding-left: 20px;
            font-style: italic;
            color: var(--muted);
            background: var(--quote-bg);
            padding: 20px;
            border-radius: 0 8px 8px 0;
        }
        blockquote cite { display: block; margin-top: 10px; font-style: normal; color: var(--dark); font-weight: 600; }

        /* --- TABLE OF CONTENTS (TOC) --- */
        .toc-wrapper {
            background: white;
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 30px;
        }
        .toc-title { font-weight: 700; margin-bottom: 15px; color: var(--dark); }
        .toc-list { list-style: none; }
        .toc-item { margin-bottom: 8px; }
        .toc-link { color: var(--muted); text-decoration: none; transition: 0.2s; }
        .toc-link:hover { color: var(--primary); padding-left: 4px; }

        /* --- FOOTER BLOCKS --- */
        .related-articles {
            margin-top: 60px;
            padding-top: 40px;
            border-top: 1px solid var(--border);
        }
        
        .articles-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 24px;
        }
        .card-mini {
            background: white;
            padding: 16px;
            border-radius: 12px;
            border: 2px solid var(--border);
            transition: 0.2s;
        }
        .card-mini:hover { transform: translateY(-3px); border-color: var(--primary); }
        .card-mini h4 { font-size: 1rem; margin-bottom: 8px; color: var(--dark); }
        .card-mini p { font-size: 0.85rem; color: var(--muted); margin-bottom: 0; }

        /* Profile */
        /* --- PROGRESS BAR --- */
        .profile-progress-wrapper {
            background: white;
            padding: 20px;
            border-radius: 12px;
            border: 2px solid var(--border);
            margin-bottom: 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }
        .progress-text { font-weight: 600; color: var(--dark); }
        .progress-bar-bg {
            flex-grow: 1;
            height: 8px;
            background: var(--border);
            border-radius: 4px;
            overflow: hidden;
            margin: 0 20px;
        }
        .progress-fill {
            height: 100%;
            background: var(--primary);
            width: 65%; /* Динамическое значение в реальном проекте */
            transition: width 0.5s ease;
        }

        /* --- FORM STYLES --- */
        .settings-form {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
        }

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

        .form-section {
            background: var(--surface);
            padding: 24px;
            border-radius: 16px;
            border: 2px solid var(--border);
        }
        

        .input-group { margin-bottom: 20px; }
        label {
            display: block;
            margin-bottom: 8px;
            color: var(--dark);
            font-weight: 500;
        }
        input[type="text"],
        input[type="email"],
        input[type="password"],
        select,
        textarea {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        input:focus, select:focus, textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        textarea { resize: vertical; min-height: 100px; }

        /* --- AVATAR UPLOAD --- */
        .avatar-upload-area {
            text-align: center;
            padding: 30px 20px;
            border: 2px dashed var(--border);
            border-radius: 12px;
            cursor: pointer;
            position: relative;
            margin-bottom: 20px;
            background: #fafafa;
        }
        .avatar-preview {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            object-fit: cover;
            margin: 0 auto 15px;
            border: 3px solid white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .upload-icon {
            font-size: 48px;
            color: var(--muted);
            margin-bottom: 10px;
            display: block;
        }
        .upload-text { color: var(--muted); font-size: 0.9rem; }
        #avatarInput { display: none; }

        /* --- TAGS / SKILLS --- */
        .skills-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
        .skill-tag {
            background: #eff6ff;
            color: var(--primary);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.85rem;
            border: 1px solid #dbeafe;
        }
        .add-skill-input {
            border: none;
            padding: 0;
            color: inherit;
            background: transparent;
            width: auto;
        }

        /* Security */
        /* --- SAFE DEAL EXPLAINER --- */
        .deal-steps {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            margin-bottom: 60px;
        }
        .step-card {
            background: var(--surface);
            padding: 30px;
            border-radius: 16px;
            border: 2px solid var(--primary);
            text-align: center;
        }
        .step-icon {
            font-size: 40px;
            margin-bottom: 20px;
            display: block;
        }
        .step-title { font-weight: 700; color: var(--dark); margin-bottom: 12px; }
        .step-desc { color: var(--muted); }

        /* --- STATISTICS BLOCK --- */
        .stats-wrapper {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 60px;
        }
        .stat-item {
            background: white;
            padding: 10px 0;
            border-radius: 5px;
            text-align: center;
            border:1px solid var(--border);
            width: 25%;
        }
        .stat-number {
            display: block;
            font-size: 2rem;
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 8px;
        }
        .stat-label { color: var(--muted); font-weight: 500; }

        /* --- FREELANCERS LIST --- */
        section.freelancers-section {
            margin-top: 60px;
            margin-bottom: 60px;
        }

        .freelancers-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 24px;
        }
        
        .f-card {
            background: var(--surface);
            border: 2px solid var(--border);
            border-radius: 16px;
            overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
            display: flex;
            flex-direction: column;
        }
        .f-card:hover {
            border: 2px solid var(--primary);
        }

        .f-header {
            height: 140px;
            background: linear-gradient(135deg, #a855f7, #ec4899);
            position: relative;
        }
        .avatar-badge {
            position: absolute;
            bottom: -25px;
            left: 20px;
            width: 70px;
            height: 70px;
            border-radius: 50%;
            border: 4px solid white;
            object-fit: cover;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .f-body {
            padding: 20px;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }
        .f-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; color: var(--dark); }
        .f-role { color: var(--muted); font-size: 0.9rem; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
        
        .f-stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-top: 15px;
            border-top: 1px solid #f1f5f9;
        }
        .f-stat-val { font-weight: 700; color: var(--primary); }
        .f-stat-label { font-size: 0.8rem; color: var(--muted); }

        .f-quote {
            background: #f8fafc;
            padding: 15px;
            border-left: 4px solid var(--primary);
            font-style: italic;
            color: #475569;
            margin-bottom: 15px;
            font-size: 0.95rem;
            flex-grow: 1;
        }

        .f-actions {
            margin-top: auto;
            padding-top: 20px;
            border-top: 1px solid #e2e8f0;
        }
        .btn-hire {
            width: 100%;
            padding: 12px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }
        .btn-hire:hover { background: #1d4ed8; }

        .center {
            text-align: center;
        }
        body > .container {
            min-height: 70vh;
        }

        /* pm */
        .new-pm-link {
            color: #11b546!important;
            display: inline-block;
        }
        .new-pm-link > .btn, .pm-link > .btn {
            border: unset!important;
        }
        .new-pm {
            display: inline-block;
            position: relative;
            vertical-align: top;
            padding: 0;
            font-size: 0;
            background: #28d03d;
            width: 5px;
            height: 5px;
            border-radius: 10px;
            margin-left: -10px;
            margin-right: 10px;
        }
        .new-pm-link {
            -webkit-animation: 1.2s ease-in-out 0s normal none infinite running trambling-animation;
            -moz-animation: 1.2s ease-in-out 0s normal none infinite running trambling-animation;
            -o-animation: 1.2s ease-in-out 0s normal none infinite running trambling-animation;
            animation: 1.2s ease-in-out 0s normal none infinite running trambling-animation;
        }
        @keyframes trambling-animation {
           0%, 50%, 100% {
             transform: rotate(0deg);
             -webkit-transform: rotate(0deg);
             -moz-transform: rotate(0deg);
             -o-transform: rotate(0deg);
             -ms-transform: rotate(0deg);
           }
           10%, 30% {
             transform: rotate(-10deg);
             -webkit-transform: rotate(-10deg);
             -moz-transform: rotate(-10deg);
             -o-transform: rotate(-10deg);
             -ms-transform: rotate(-10deg);
           }
           20%, 40% {
             transform: rotate(10deg);
             -webkit-transform: rotate(10deg);
             -moz-transform: rotate(10deg);
             -o-transform: rotate(10deg);
             -ms-transform: rotate(10deg);
           }
        }

        /* checkbox */
        .toggle-switch {
          position: relative;
          display: inline-flex;
          align-items: center;
          cursor: pointer;
          user-select: none;
          margin: 12px 0;
        }

        /* Скрываем оригинальный чекбокс (старый вариант) */
        .toggle-switch input {
          opacity: 0;
          width: 0;
          height: 0;
          position: absolute;
        }

        /* Стили ползунка (старый вариант) */
        .toggle-slider {
          position: relative;
          width: 52px;
          height: 28px;
          background-color: #e0e0e0;
          border-radius: 36px;
          transition: all 0.3s ease;
          margin-right: 10px;
        }

        /* Кружок внутри ползунка (старый вариант) */
        .toggle-slider::before {
          content: '';
          position: absolute;
          top: 2px;
          left: 2px;
          width: 24px;
          height: 24px;
          background: white;
          border-radius: 50%;
          transition: transform 0.3s ease;
        }

        /* Состояние: включено (старый вариант) */
        .toggle-switch input:checked ~ .toggle-slider {
          background-color: #4CAF50;
        }

        .toggle-switch input:checked ~ .toggle-slider::before {
          transform: translateX(24px);
        }

        /* Состояние: фокус (старый вариант) */
        .toggle-switch input:focus ~ .toggle-slider {
          box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
        }

        /* Состояние: отключено (старый вариант) */
        .toggle-switch input:disabled ~ .toggle-slider {
          background-color: #f5f5f5;
          cursor: not-allowed;
        }

        .toggle-switch input:disabled ~ .toggle-slider::before {
          background: #ccc;
        }

        /* Текст метки (старый вариант) */
        .toggle-label {
          font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
          font-size: 14px;
          color: #333;
          line-height: 1;
        }

        /* --- НОВАЯ СТРУКТУРА: form-check-label --- */
        input[type="checkbox"] {
            display: none;
        }
        #dle-comments-list input[type="checkbox"] {
            display: block;
        }

        /* Контейнер-обёртка, которую создаст JS */
.toggle-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin: 12px 0;
}

/* Трек ползунка */
.toggle-track {
  width: 52px;
  height: 28px;
  background-color: var(--muted, #e0e0e0);
  border-radius: 36px;
  transition: background-color 0.3s ease;
  margin-right: 10px;
  flex-shrink: 0;
  position: relative;
}

/* Кружок-ручка */
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Состояние: включено */
.toggle-wrapper.is-checked .toggle-track {
  background-color: var(--primary, #4CAF50);
}

.toggle-wrapper.is-checked .toggle-knob {
  transform: translateX(24px);
}

/* Фокус (для доступности) */
.toggle-wrapper:focus-within .toggle-track {
  box-shadow: 0 0 0 3px rgba(44, 162, 111, 0.2);
}

/* Отключённое состояние */
.toggle-wrapper.is-disabled .toggle-track {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.toggle-wrapper.is-disabled .toggle-knob {
  background: #ccc;
}


        /* Дополнительные размеры для новой структуры */
        .form-check-label.small {
          --toggle-width: 40px;
          --toggle-height: 22px;
          --toggle-thumb: 18px;
        }

        .form-check-label.large {
          --toggle-width: 64px;
          --toggle-height: 34px;
          --toggle-thumb: 30px;
        }

        .form-check-label.small span,
        .form-check-label.large span {
          width: var(--toggle-width);
          height: var(--toggle-height);
        }

        .form-check-label.small span::before,
        .form-check-label.large span::before {
          width: var(--toggle-thumb);
          height: var(--toggle-thumb);
        }

        .form-check-label.small input:checked ~ span::before,
        .form-check-label.large input:checked ~ span::before {
          transform: translateX(calc(var(--toggle-width) - var(--toggle-thumb) - 4px));
        }

        /* Цветовые темы для новой структуры (аналогично старому варианту) */
        .form-check-label.toggle-primary span { background-color: #2196F3; }
        .form-check-label.toggle-primary input:checked ~ span { background-color: #0D47A1; }

        .form-check-label.toggle-danger span { background-color: #F44336; }
        .form-check-label.toggle-danger input:checked ~ span { background-color: #B71C1C; }

        .form-check-label.toggle-warning span { background-color: #FF9800; }
        .form-check-label.toggle-warning input:checked ~ span { background-color: #E65100; }


        #mass_action {
            width: auto!important;
            padding: 7px 14px!important;
        }
        .comment {
            border: 2px solid var(--border)!important;
            cursor: auto;
        }
        .comments-tree-list {
            list-style: none;
            padding-top: 10px;
        }
        .comments-tree-list ol .task-card {
            background: var(--border);
        }
        .comments-tree-list ol .task-card .signature {
            display: none!important;
        }
        .comments-tree-list ol .task-card > div:first-child, .comments-tree-list ol .task-card .flex > .subtitle {
            display: none!important;
        }
        .my_bg {
            background: var(--bg);
            border: 2px solid var(--primary) !important;
        }
        #dle-comments-list > ol {
            margin-block-start: 0;
            margin-block-end: 0;
            padding-inline-start: 0;
        }
        #dle-comments-list ol {
            list-style: none;
        }

        /* navi */
        .navigation { margin: 25px 0; }
        .navigation:after { clear: both; display: block; content: ""; }

        .pages { text-align: left; }
        .pages span, .pages a:hover, .page_next-prev { 
            background-color: #fff;
            box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); -webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
            border-radius: 8px;
        }
        .pages span, .pages a {
            color: inherit;
            display: inline-block;
            position: relative;
            padding: 7px 7px;
            min-width: 35px; line-height: 22px;
            text-align: center;
            text-decoration: none !important;
            font-weight: bold;
        }
        .pages span { color: var(--dark); }
        .pages a:hover { color: #fff; background-color: var(--primary); }
        .pages span { color: var(--primary); }

        .page_next-prev { float: right; height: 36px; }
            .page_next-prev * { float: left; }
            .page_next-prev .icon { width: 32px; height: 20px; fill: #d7d7d7; }
            .page_next-prev > span >  a:hover .icon { fill: #0c5f7eed; }
            .page_next-prev > span > * { float: left; padding: 5px 12px; }

        .page_next > span, .page_prev > span { opacity: 0.5; }

        .splitnewsnavigation { margin-top: 4%; padding-top: 4%; font-weight: bold; border-top: 1px solid #efefef; }
        .splitnewsnavigation > a, .splitnewsnavigation > span { padding: 6px 10px; }

        /* Затемнение фона */
        .overlay {
          position: fixed;
          top: 0; left: 0; right: 0; bottom: 0;
          background: rgba(0, 0, 0, 0.6);
          opacity: 0;
          visibility: hidden;
          transition: opacity 0.3s, visibility 0.3s;
          z-index: 9998;
          backdrop-filter: blur(2px);
        }
        .overlay.active {
          opacity: 1;
          visibility: visible;
        }

        /* Модальное окно */
        .modal {
          position: fixed;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          width: 100%;
          max-width: 500px;
          background: white;
          border-radius: 12px;
          box-shadow: 0 10px 25px rgba(0,0,0,0.2);
          z-index: 9999;
          opacity: 0;
          visibility: hidden;
          transform: translate(-50%, -40px);
          transition: all 0.3s ease;
        }
        .modal.active {
          opacity: 1;
          visibility: visible;
          transform: translate(-50%, -50%);
        }

        .modal-content {
          padding: 24px;
          position: relative;
          max-height: 600px;
            overflow: auto;
        }

        .modal-close {
          position: absolute;
          top: 12px;
          right: 16px;
          background: none;
          border: none;
          font-size: 24px;
          line-height: 1;
          color: #aaa;
          cursor: pointer;
        }
        .modal-close:hover { color: #000; }

        /* Блок оценки */
        .rating-block {
          display: flex;
          gap: 12px;
          margin: 20px 0;
          flex-wrap: wrap;
        }

        .rating-option {
          flex: 1 1 140px;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: 0;
          border-radius: 7px!important;
          overflow: hidden;
          cursor: pointer;
          border: 2px solid transparent;
          transition: all 0.2s;
          text-align: center;
        }

        /* Скрываем нативный radio */
        .rating-option input {
          position: absolute;
          opacity: 0;
          width: 0;
          height: 0;
        }

        /* Цвета для каждого типа оценки */
        .rating-option.positive {
          background: #ecfdf5;
          color: #065f46;
        }
        .rating-option.positive:hover { background: #a7f3d0; }
        .rating-option.positive input:checked ~ span {
          background: #10b981;
          color: white;
        }

        .rating-option.neutral {
          background: #f8fafc;
          color: #475569;
        }
        .rating-option.neutral:hover { background: #e2e8f0; }
        .rating-option.neutral input:checked ~ span {
          background: #64748b;
          color: white;
        }

        .rating-option.negative {
          background: #fffbeb;
          color: #92400e;
        }
        .rating-option.negative:hover { background: #fef3c7; }
        .rating-option.negative input:checked ~ span {
          background: #b45309;
          color: white;
        }

        /* Стили для текста внутри label */
        .rating-option span {
          display: block;
          width: 100%;
          padding: 8px 0;
          font-weight: 500;
          transition: background 0.2s, color 0.2s;
        }

        /* Поле комментария */
        .form-group { margin: 16px 0; }
        .form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #333; }
        .form-group textarea {
          width: 100%;
          padding: 10px;
          border: 1px solid #ccc;
          border-radius: 6px;
          resize: vertical;
          font-family: inherit;
        }
        .form-group textarea:focus {
          outline: none;
          border-color: #2563eb;
          box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        /* Кнопки в попапе */
        .modal-actions {
          display: flex;
          gap: 12px;
          margin-top: 20px;
        }
        .btn-submit {
          flex: 1;
          background: #2563eb;
          color: white;
          border: none;
          padding: 12px;
          border-radius: 8px;
          cursor: pointer;
          font-weight: 500;
        }
        .btn-submit:hover { background: #1d4ed8; }
        .btn-cancel {
          flex: 1;
          background: transparent;
          border: 1px solid #ccc;
          padding: 12px;
          border-radius: 8px;
          cursor: pointer;
        }
        .btn-cancel:hover { border-color: #888; }

        /* Other */
        .flex {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-start;
            gap: 20px;
        }

        .fl-list {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .fl-list img {
            width: 80px;
            height: 80px;
        }
        .fl-list.rounded img {
            padding: 3px;
            border: 2px solid var(--primary);
        }

        /* Footer */
        footer {
            background: var(--dark);
            padding: 60px 0 20px;
            color: #fff;
        }
        .footer-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 40px;
            margin-bottom: 40px;
        }
        .footer-grid a {
            display: block;
        }
        .footer-grid div {
            margin: 0 0 10px;
            text-align: left;
        }
        .footer h4 { color: white; margin-bottom: 16px; }
        .footer ul li { margin-bottom: 8px; }
        .copyright { text-align: center; border-top: 1px solid #334155; padding-top: 20px; font-size: 0.9rem; }

        /* Mobile adjustments */
        @media (max-width: 768px) {
            .logo span { display: none; }
            .hero h1 { font-size: 1.3rem; }
            .nav-links { display: none; } /* Упрощение для демо */
            .roles-grid { grid-template-columns: 1fr; }
            .cta-group { flex-direction: column; width: 100%; }
            .btn { width: 100%; text-align: center; }
        }

button img {
    width: 19px;
    vertical-align: middle;
    margin-right: 10px;
}

/* --- Mobile Menu Base --- */
.mobile-menu-toggle {
    display: none; /* Скрыто по умолчанию */
    background: none;
    border: none;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}
.mobile-menu-toggle img {
    width: 19px;
    vertical-align: middle;
}

.mobile-menu-toggle:hover {
    color: var(--primary);
}
.mobile-menu-close a {
    display: none;
}

@media screen and (max-width: 1023px) {
    .tab-btn {
        width: 100%;
    }
    .profile-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .stat-item {
        border: 1px solid var(--border);
        width: calc(50% - 5px);    
    }
}


/* --- Mobile-only: показываем кнопку и скрываем обычное меню --- */
@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    nav {
        justify-content: space-between;
        align-items: center;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 70vw; /* до 70% экрана */
        height: 100vh;
        background: var(--surface);
        border-left: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 0;
        margin: 0;
        transform: translateX(100%); /* скрыто справа */
        transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
        z-index: 1000;
        box-shadow: -4px 0 16px rgba(0,0,0,0.06);
        box-shadow: -155px 0 55px 0px rgba(0, 0, 0, 0.25);
    }

    /* Состояние «меню открыто» */
    nav.menu-open .nav-links {
        display: block;
        transform: translateX(0);
    }

    .nav-links li {
        margin: 16px 0;
    }

    .nav-links a {
        display: block;
        font-size: 1.1rem;
        color: var(--text);
        padding: 10px 20px;
        border-bottom: 1px solid transparent;
    }
    .nav-links img {
        width: 19px;
        margin: 10px 20px;
    }
    .nav-links a.close {
        display: block;
    }

    .nav-links a:hover {
        color: var(--primary);
        border-bottom-color: var(--border);
    }

    /* Затемнение фона */
    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
    }

    nav.menu-open ~ .overlay {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-close a {
        display: inline-block;
        float: right;
        text-align: right;
        color: var(--muted);
        font-size: 0.95rem;
        padding: 8px 0;
        border: unset!important;
        margin-bottom: 16px;
    }

    .mobile-menu-close a:hover {
        color: var(--primary);
    }

}
