:root {
    --primary-color: #2F6C4F; /* Nature green */
    --primary-light: #4A9073;
    --primary-dark: #1F4A35;
    --secondary-color: #8C6A48; /* Earthy brown */
    --accent-color: #E6B566; /* Warm yellow/sun */
    --bg-color: #F4F7F5; /* Soft light grayish green */
    --card-bg: #FFFFFF;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #E2E8E4;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

/* Header */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 50px;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu li a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-menu li a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-auth {
    display: flex;
    gap: 15px;
}

.btn-login, .btn-register {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.btn-login {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-login:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-register {
    background: var(--primary-color);
    color: #fff;
}

.btn-register:hover {
    background: var(--primary-dark);
}

/* Hero Section */
.hero {
    position: relative;
    background: url('../img/bg1.jpg') no-repeat center center/cover;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    border-bottom: 5px solid var(--primary-color);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(31, 74, 53, 0.6); /* Greenish dark overlay */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero-content h2 {
    color: #fff;
    font-size: 42px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 20px;
}

.address-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    font-size: 14px;
}

/* Layout */
.main-wrapper {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 40px;
    padding: 50px 0;
}
.content-main { grid-column: 2; grid-row: 1; }
.sidebar { grid-column: 1; grid-row: 1; }

/* News Feed */
.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.news-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.news-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.impotant {
    color: #D32F2F;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    background: #FFEBEE;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.news-text {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.news-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 15px;
}

.news-meta i {
    color: var(--primary-light);
    margin-right: 5px;
}

.btn-read-more {
    background: var(--primary-light);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.btn-read-more:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.pagination a.active, .pagination a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Sidebar */
.sidebar-block {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}

.sidebar-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-color);
}

.sidebar-header img {
    width: 24px;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: block;
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    padding-left: 18px;
}

.sbnews {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.sbnews:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sbnews .title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.sbnews p {
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.sbnews .link {
    font-size: 13px;
    color: var(--primary-light);
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: #fff;
    padding: 40px 0 20px;
    text-align: center;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.footer-social {
    margin-bottom: 20px;
    color: #ccc;
}

.footer-social a {
    color: var(--accent-color);
}

.copyright {
    font-size: 13px;
    color: #999;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 20px;
}

.copyright a {
    color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
    .main-wrapper {
        display: flex;
        flex-direction: column;
    }
    .content-main { order: 1; }
    .sidebar { order: 2; }

    .nav-menu {
        display: none; /* In real project, use JS for mobile menu */
    }
}

/* =========================================
   SUBPAGES AND COMPONENTS
========================================= */

/* Subpage Header */
.subpage-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}
.subpage-title {
    font-size: 28px;
    color: var(--primary-dark);
}

/* Documents Grid */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.doc-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    transition: var(--transition);
}
.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: var(--primary-light);
}
.doc-icon {
    font-size: 36px;
    margin-right: 20px;
    width: 40px;
    text-align: center;
}
.doc-icon.pdf { color: #e53e3e; }
.doc-icon.word { color: #3182ce; }
.doc-icon.excel { color: #38a169; }

/* Forms (Login / Register / Feedback) */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 35px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.form-container.wide {
    max-width: 100%;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-dark);
}
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--text-main);
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 108, 79, 0.15);
}
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
}
.btn-submit:hover {
    background: var(--primary-dark);
}

/* Voting / Polls */
.poll-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    background: var(--card-bg);
    border-left: 5px solid var(--primary-color);
}
.poll-card.closed {
    border-left-color: #a0aec0;
    opacity: 0.85;
}
.poll-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}
.poll-badge.active {
    background: #e6fffa;
    color: #2f855a;
}
.poll-badge.closed {
    background: #edf2f7;
    color: #4a5568;
}
.poll-progress-bg {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 12px;
}
.poll-progress-bar {
    height: 100%;
    background: var(--primary-color);
}

/* Forum */
.forum-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.forum-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr;
    background: var(--bg-color);
    padding: 15px 20px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}
.forum-cat {
    background: #e2e8f0;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #4a5568;
    text-transform: uppercase;
}
.forum-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background 0.2s;
}
.forum-row:hover {
    background: #f8fafc;
}
.forum-row:last-child {
    border-bottom: none;
}
.forum-icon {
    font-size: 26px;
    color: var(--primary-light);
    margin-right: 20px;
    width: 30px;
    text-align: center;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--border-color);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img {
    transform: scale(1.08);
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31, 74, 53, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;
    font-size: 28px;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Debtors Table */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}
.table th, .table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}
.table tr:last-child td {
    border-bottom: none;
}
.table tr:hover {
    background: #f8fafc;
}
.text-danger {
    color: #e53e3e;
    font-weight: 600;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.08);
    z-index: 2000;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--border-color);
}
.mobile-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    padding: 12px 0 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.mobile-bottom-nav .nav-item i { font-size: 22px; }
.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}
.mobile-bottom-nav .nav-item:hover {
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .mobile-bottom-nav { display: flex; }
    body { padding-bottom: 60px; }
    footer { padding-bottom: 80px; }
}

/* --- Dropdown Menus --- */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-radius: var(--border-radius);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu li a {
    display: block !important;
    padding: 10px 20px !important;
    border-radius: 0 !important;
    font-weight: 500 !important;
}
.nav-dropdown-menu li a:hover {
    background: var(--bg-color) !important;
}

/* Sidebar Dropdown */
.sidebar-submenu {
    display: none;
    padding-left: 0;
    margin-top: 5px;
    margin-bottom: 5px;
    border-left: 2px solid var(--border-color);
    margin-left: 15px;
}
.sidebar-dropdown:hover .sidebar-submenu {
    display: block;
    animation: fadeIn 0.3s ease;
}
.sidebar-submenu li { margin-bottom: 2px; }
.sidebar-submenu a { font-size: 13px !important; padding: 6px 15px !important; }

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

/* Responsive Forum Posts */
.post-card {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}
.post-author {
    background: var(--bg-color);
    padding: 20px;
    width: 200px;
    border-right: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}
.post-author.admin {
    background: #e6fffa;
}
.post-author .avatar {
    width: 60px;
    height: 60px;
    background: #cbd5e1;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}
.post-author.admin .avatar {
    background: #38a169;
}
.post-content {
    padding: 20px;
    flex-grow: 1;
}

@media (max-width: 576px) {
    .post-card {
        flex-direction: column;
    }
    .post-author {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        padding: 15px;
        text-align: left;
        gap: 15px;
    }
    .post-author .avatar {
        margin: 0;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Document Categories */
.docs-category-title {
    font-size: 20px;
    color: var(--primary-dark);
    margin-top: 35px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.docs-category-title:first-of-type {
    margin-top: 0;
}

/* Folder Icons */
.doc-icon.folder {
    color: #ecc94b; /* Warm yellow/gold for folders */
}

/* =========================================
   LEGACY BRIDGE — старая разметка модулей
   (.cont/.title/.text и пр.) в новом дизайне
   ========================================= */
.cont {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.cont > .title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}
.cont > .text {
    color: var(--text-main);
    line-height: 1.7;
}
.cont .info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 15px;
    align-items: center;
}
.cont .info i { color: var(--primary-light); }
.cont .next { text-align: right; margin-top: 15px; }
.cont .next .button { border: none; }

.button {
    display: inline-block;
    background: var(--primary-light);
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--primary-light);
    cursor: pointer;
    transition: var(--transition);
}
.button:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.link { color: var(--primary-color); font-weight: 500; }
.link:hover { color: var(--primary-dark); }

.input, .textarea, select.input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--text-main);
    margin-bottom: 5px;
}
.input:focus, .textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 108, 79, 0.15);
}
legend {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-dark);
}

/* Сообщения (Messages) */
.message {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 14px;
}
.message i { margin-right: 10px; }
.message.errors { border-left: 5px solid #e53e3e; color: #c53030; }
.message.errors i { color: #e53e3e; }
.message.infos { border-left: 5px solid #38a169; color: #2f855a; }
.message.infos i { color: #38a169; }
.message.warnings { border-left: 5px solid #ecc94b; color: #975a16; }
.message.warnings i { color: #ecc94b; }

/* Файлы */
.file {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #fff;
    margin-bottom: 12px;
    transition: var(--transition);
}
.file:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: var(--primary-light);
}
.file .img { font-size: 0; margin-right: 18px; width: 40px; text-align: center; }
.file .img img { width: 34px; }
.file .title {
    font-size: 14px !important;
    font-weight: 500;
    color: var(--text-main);
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-grow: 1;
}
.file .title p { font-size: 12px; color: #888; font-weight: 400; margin: 3px 0 0; }
.file .down, .file .view { margin-left: 15px; }
.file .down a, .file .view a, .file .not {
    color: var(--primary-light);
    font-size: 18px;
}
.file .not { color: #cbd5e0; }

/* Комментарии */
.comm { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--border-color); }
.comm .img { flex-shrink: 0; }
.comm .img img {
    width: 46px; height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: #cbd5e1;
}
.comment { flex-grow: 1; font-size: 14px; color: var(--text-main); }
.comment .author { font-weight: 600; margin-right: 10px; }
.comment .date { font-size: 12px; color: #999; }

/* Блоки внутри Контента — для совместимости старых шаблонов */
.block {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.title_block {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px; font-weight: 600;
    color: var(--primary-dark);
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--bg-color);
}
.title_block .icon img { width: 24px; }

/* Кнопка-бургер в шапке */
.burger-toggle {
    display: none;
    color: var(--primary-color);
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
}
.nav-menu.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 10px 20px; border-bottom: 1px solid var(--border-color); z-index: 1000; }
@media (max-width: 992px) {
    .burger-toggle { display: block; }
}

/* Hero адаптация под высоту шапки из theme.json */
.hero h2 { font-size: clamp(24px, 4vw, 42px); }
.nav-menu li a.active { background: var(--bg-color); color: var(--primary-color); }
.mobile-bottom-nav .nav-item.active { color: var(--primary-color); }
.nav-menu li a.active { background: var(--bg-color); color: var(--primary-color); }
.mobile-bottom-nav .nav-item.active { color: var(--primary-color); }

/* --- шапка: компактные кнопки, отступы от лого --- */
.navbar-container { gap: 12px; }
.logo { margin-right: 8px; }
.nav-auth { gap: 8px; flex-shrink: 0; }
.btn-login, .btn-register {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 18px;
}
.burger-toggle { margin-left: 2px; padding: 8px 10px; flex-shrink: 0; }
@media (max-width: 768px) {
    .logo img { height: 38px; }
    .nav-auth .has-icon { padding: 10px; font-size: 15px; }
    .nav-auth .has-icon span { display: none; } /* иконки вместо текста */
    .burger-toggle { padding: 10px 11px; font-size: 17px; }
}

/* =========================================
   Адаптив: глобальные правила (v8)
========================================= */
img, video, iframe, embed { max-width: 100%; }
.logo img { max-width: none; flex-shrink: 0; } /* лого не схлопывать в flex-шапке */
img { height: auto; }
.content, .content-main, .post-content, h1, h2, h3, h4 { overflow-wrap: anywhere; }
.content-main, .main-wrapper > * { min-width: 0; }

@media (max-width: 992px) {
    .nav-menu.open {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }
    .nav-menu.open li { width: 100%; }
    .nav-menu.open li a { display: flex; align-items: center; min-height: 44px; }
    .nav-menu.open .nav-dropdown-menu {
        position: static; min-width: 0; width: 100%;
        opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; display: none;
        padding-left: 15px;
    }
    .nav-menu.open .nav-dropdown.open > .nav-dropdown-menu { display: block; }
    .nav-menu.open .nav-dropdown:hover .nav-dropdown-menu { transform: none; }
    .nav-dropdown-menu { max-width: calc(100vw - 20px); }
    /* touch: открытие по клику (.open) */
    .sidebar-dropdown:hover .sidebar-submenu { display: none; animation: none; }
    .sidebar-dropdown.open .sidebar-submenu { display: block; animation: fadeIn 0.3s ease; }
    .sidebar { width: 100%; max-width: 100%; }
    .sidebar a { min-height: 44px; }
}
.nav-dropdown.open > .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 768px) {
    .post-card { flex-direction: column; }
    .post-author {
        width: 100%; border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .content table { display: block; max-width: 100%; overflow-x: auto; }
    .form-container { padding: 25px 20px; }
}

@media (max-width: 414px) {
    .container { padding: 0 14px; }
    .form-container { padding: 20px 15px; max-width: 100%; }
    .form-container .btn, .form-container button, .form-container input[type=submit] { width: 100%; }
    input, select, textarea { font-size: 16px !important; max-width: 100%; }
    .btn { padding-left: 16px; padding-right: 16px; }
    .post-content, .post-author { padding: 14px; }
    .table th, .table td { padding: 10px 12px; }
    h1 { font-size: 24px; }
    h2 { font-size: 21px; }
    h3 { font-size: 18px; }
}

/* --- шапка: фикс регрессий v9 --- */
.logo { flex-shrink: 0; }
.navbar-container > nav { min-width: 0; }
.nav-menu { flex-wrap: nowrap; gap: 4px 12px; }
.nav-menu > li { flex: 0 0 auto; }
.nav-menu > li > a { display: block; white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 992px) {
    .navbar-container > nav { flex: 0 0 auto; }
    .nav-auth { margin-left: auto; align-items: center; gap: 8px; }
    .nav-auth .has-icon {
        width: 40px; height: 40px; padding: 0; justify-content: center;
        border-radius: 50%; font-size: 16px; box-sizing: border-box;
    }
    .nav-auth .has-icon span { display: none; }
    .burger-toggle {
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; padding: 0; margin-left: 0;
        font-size: 20px; box-sizing: border-box;
    }
}
@media (min-width: 993px) {
    .navbar-container.container { max-width: 1600px; padding-left: 20px; padding-right: 20px; }
    .nav-menu { gap: 0 4px; }
}
@media (min-width: 993px) and (max-width: 1500px) {
    .navbar-container { gap: 8px; }
    .nav-menu > li > a { font-size: 14px; padding: 8px 8px; }
    .nav-auth .has-icon span { display: none; }
    .nav-auth .has-icon { padding: 8px 11px; }
}
.navbar-container { padding-left: 20px; padding-right: 20px; }
@media (max-width: 414px) { .navbar-container { padding-left: 14px; padding-right: 14px; } }

/* --- контент постов v10 --- */
.news-text,
.post-content,
.cont > .text {
    overflow-wrap: anywhere;
    word-wrap: break-word;
    min-width: 0;
    display: flow-root;
}
.news-text p, .post-content p, .cont > .text p { margin-bottom: 0.8em; }
.news-text ol, .news-text ul,
.post-content ol, .post-content ul,
.cont > .text ol, .cont > .text ul {
    padding-left: 1.8em;
    margin: 0 0 0.8em;
    list-style-position: outside;
}
.news-text ol, .post-content ol, .cont > .text ol { list-style-type: decimal; }
.news-text ul, .post-content ul, .cont > .text ul { list-style-type: disc; }
.news-text li, .post-content li, .cont > .text li { margin-bottom: 0.3em; }
.news-text blockquote, .post-content blockquote, .cont > .text blockquote {
    margin: 0 0 0.8em;
    padding: 8px 0 8px 16px;
    border-left: 3px solid var(--border-color);
    max-width: 100%;
}
.news-text pre, .post-content pre, .cont > .text pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
}
.news-text table, .post-content table, .cont > .text table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
.news-text img, .post-content img, .cont > .text img { max-width: 100%; height: auto; }
.news-text img:not([align]):not([style*="float"]):not([style*="margin"]):not([style*="display"]),
.post-content img:not([align]):not([style*="float"]):not([style*="margin"]):not([style*="display"]),
.cont > .text:not(.gallery-item) img:not([align]):not([style*="float"]):not([style*="margin"]):not([style*="display"]) {
    float: none;
    display: block;
    max-width: min(100%, 480px);
    height: auto;
    margin: 0 0 18px;
    border-radius: var(--border-radius);
}
.cont .file img, .post-content .file img { float: none !important; max-width: none !important; margin: 0 !important; border-radius: 0 !important; display: inline !important; }

/* --- форум v12 --- */
.forum { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); overflow: hidden; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.forum > .title { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 16px; color: var(--primary-dark); }
.forum > .title .forumRight { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12px; color: var(--text-muted); }
.forumItem { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border-color); transition: background 0.2s; }
.forumItem:last-child { border-bottom: none; }
.forumItem:hover { background: var(--bg-color); }
.forumLeft { position: relative; flex: 1 1 auto; min-width: 0; padding-left: 56px; }
.forumLeft .img { position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--bg-color); color: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.forumLink { font-weight: 600; font-size: 16px; color: var(--primary-color); text-decoration: none; }
.forumLink:hover { color: var(--primary-dark); text-decoration: underline; }
.forumLeft p { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.forumLeft p.author a { color: var(--primary-color); }
.forumRight { display: flex; flex: 0 0 auto; gap: 8px; text-align: center; }
.forumRight .ntheme, .forumRight .nmess { width: 90px; }
.forumRight .act { width: 200px; text-align: left; }
.forumItem .forumRight .ntheme, .forumItem .forumRight .nmess { font-size: 16px; font-weight: 600; color: var(--text-main); }
.forumItem .forumRight .act { font-size: 13px; color: var(--text-muted); }
.noForum { padding: 20px; color: var(--text-muted); }
.forumItem:has(> .forumPost) { display: block; padding: 0; }
.forumPost { display: grid; grid-template-columns: 50px minmax(0, 1fr); column-gap: 16px; align-items: start; width: 100%; box-sizing: border-box; padding: 20px 24px; min-width: 0; }
.forumPost > * { grid-column: 2; min-width: 0; }
.forumPost .img { grid-column: 1; grid-row: 1 / span 5; width: 50px; height: 50px; flex: 0 0 50px; border-radius: 50%; overflow: hidden; background: var(--bg-color); }
.forumPost .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.forumTop { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; width: 100%; }
.forumTop .author { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--primary-color); text-decoration: none; overflow-wrap: anywhere; }
.forumTop .date { flex: 0 0 auto; margin-left: auto; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.postTitle { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 18px; margin-bottom: 8px; }
.postText { overflow-wrap: anywhere; line-height: 1.6; }
.postText img { max-width: 100%; height: auto; }
.postText blockquote { margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--primary-light); background: var(--bg-color); border-radius: 6px; }
.forumBottom { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 12px; width: 100%; font-size: 16px; }
.forumBottom a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; color: var(--text-muted); transition: color 0.2s; }
.forumBottom a:hover { color: var(--accent-color); }
@media (max-width: 768px) {
    .forum > .title .forumRight { display: none; }
    .forumItem { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
    .forumRight { flex-wrap: wrap; justify-content: flex-start; gap: 4px 16px; padding-left: 56px; text-align: left; }
    .forumRight .ntheme, .forumRight .nmess, .forumRight .act { width: auto; font-size: 13px !important; font-weight: 400 !important; }
    .forumRight .ntheme::before { content: "Темы: "; }
    .forumRight .nmess::before { content: "Сообщения: "; }
    .forumRight .act { flex-basis: 100%; }
}
@media (max-width: 576px) {
    .forumPost { grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; padding: 14px; }
    .forumPost .img { width: 40px; height: 40px; flex-basis: 40px; }
    .forumTop { flex-wrap: wrap; gap: 2px 12px; }
    .forumTop .author { flex: 1 1 100%; }
    .forumTop .date { margin-left: 0; }
}

/* --- документы и профиль v14 --- */
.docsCats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.docsCats a {
    display: inline-flex; align-items: center; padding: 7px 14px;
    border: 1px solid var(--border-color); border-radius: 999px;
    background: var(--card-bg); color: var(--text-main); font-size: 14px;
    text-decoration: none; transition: var(--transition);
}
.docsCats a:hover, .docsCats a.active, .docsCats a.act {
    background: var(--primary-color); border-color: var(--primary-color); color: #fff;
}

.cont > .text.profile {
    display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 32px; align-items: start;
}
.profile .ava { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.profile .ava > img {
    width: 160px; height: 160px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--border-color); background: var(--bg-color);
}
.profile .ava > a { position: absolute; top: 0; right: 8px; color: var(--text-muted); }
.profile .ava > a:hover { color: #c0392b; }
.profile .ava form { margin: 0; }
.profile #myfotolabel {
    display: inline-flex; align-items: center; padding: 7px 16px; cursor: pointer;
    border: 1px solid var(--primary-color); border-radius: 999px; color: var(--primary-color);
    font-size: 14px; transition: var(--transition);
}
.profile #myfotolabel:hover { background: var(--primary-color); color: #fff; }
.profile #myfoto { display: none; }
.profile .pf-main { min-width: 0; }
.profile .pf-main p { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border-color); line-height: 1.5; }
.profile .pf-main p.pf-name { font-size: 24px; font-weight: 700; border-bottom: 0; padding-top: 0; }
.profile .pf-label { display: inline-block; min-width: 150px; margin-right: 8px; font-weight: 400; font-size: 13px; color: var(--text-muted); }
.profile .pf-main p span { color: var(--text-main); }
.profile .pf-main span.pf-ok {
    display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px;
    background: #e3f4ea; color: var(--primary-color); font-size: 13px;
}
.profile .pf-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; }
.profile .pf-links li { list-style: none; margin: 0; }
.profile .pf-links a {
    display: inline-flex; padding: 7px 14px; border: 1px solid var(--border-color); border-radius: 999px;
    background: var(--card-bg); color: var(--text-main); font-size: 14px; text-decoration: none; transition: var(--transition);
}
.profile .pf-links a:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.profile .editlink {
    display: inline-flex; margin-top: 16px; padding: 9px 22px; border-radius: 999px;
    background: var(--primary-color); color: #fff; text-decoration: none; transition: var(--transition);
}
.profile .editlink:hover { background: var(--primary-dark); }
@media (max-width: 768px) {
    .cont > .text.profile { grid-template-columns: 1fr; }
    .profile .ava { align-items: flex-start; }
    .profile .ava > a { left: 120px; right: auto; }
    .profile .pf-label { display: block; min-width: 0; margin: 0; }
}
.cont > .text.profile .ava > img { height: 160px; max-width: none; }
.cont > .text.profile ul.pf-links { padding-left: 0; list-style: none; margin: 0 0 12px; }
.cont > .text.profile .pf-links li { margin: 0; }
.cont > .text.profile { overflow-wrap: break-word; }
.cont > .text.profile .pf-name { overflow-wrap: normal; word-break: normal; }
@media (max-width: 768px) {
    .cont > .text.profile .pf-name { overflow-wrap: break-word; font-size: 20px; }
}

/* долги и СМС-подтверждение (v14) */
.cont > table { width: 100%; border-collapse: collapse; margin-top: 12px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cont > table thead, .cont > table tbody, .cont > table tfoot { display: table; width: 100%; table-layout: auto; }
.cont > table th, .cont > table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); text-align: right; white-space: nowrap; font-size: 14px; }
.cont > table th { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.cont > table th:first-child, .cont > table td:first-child { text-align: left; }
.cont > table tfoot td { font-weight: 700; border-top: 2px solid var(--border-color); border-bottom: 0; }
.cont > table tfoot td[colspan] { text-align: left; }

.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .5); align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal.modal-open { display: flex; }
.modal .modal-dialog { width: 100%; max-width: 420px; }
.modal .modal-content { position: relative; padding: 20px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.modal .modal-title { margin: 0 40px 16px 0; font-size: 20px; }
.modal .close {
    position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 22px; line-height: 1; color: var(--text-muted); text-decoration: none;
}
.modal .close:hover { background: var(--bg-color); color: var(--text-main); }
.modal .modal-body > div { margin: 10px 0 14px; color: var(--text-muted); font-size: 14px; }
.modal #smscode {
    display: block; width: 100%; padding: 10px 12px; font-size: 18px; text-align: center; letter-spacing: 6px;
    border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg);
}
.modal #smscode:focus { outline: none; border-color: var(--primary-color); }
.modal .modal-body input.button { display: inline-block; width: auto; margin: 0 10px 0 0; padding: 10px 20px; border: 1px solid var(--primary-color); border-radius: 999px; background: var(--primary-color); color: #fff; cursor: pointer; font-size: 14px; }
.modal .modal-body input#repitcode { background: transparent; color: var(--primary-color); margin-right: 0; }
.modal .modal-body input.disabled, .modal .modal-body input:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 400px) {
    .modal .modal-body input.button { display: block; width: 100%; margin: 0 0 10px; }
}
.modal .modal-body input#repitcode.button { background: transparent; color: var(--primary-color) !important; }
.modal .modal-body input#repitcode.button:not(:disabled):hover { background: var(--primary-color); color: #fff !important; }
.modal .modal-body br { display: none; }

/* --- комментарии v15 --- */
.comments-head { margin: 24px 0 0 !important; padding-bottom: 10px; }
.comments-head .subpage-title { margin: 0; }
.comments-list { padding: 4px 24px !important; margin-top: 16px; }
.comments-list + .pagination:empty { display: none; }
.comments-list + .pagination { margin: 16px 0 0; }
.comm { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; padding: 16px 0; }
.comm:last-child { border-bottom: none; }
.comm .img img { display: block; }
.comm .comment { min-width: 0; }
.comm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }
.comm-head .author { margin: 0; color: var(--primary-color); }
.comm-head .date { margin: 0; color: var(--text-muted); }
.comment p:last-child { margin-bottom: 0; }

.form-container.comment-form {
    max-width: none; width: 100%; margin: 24px 0 0; padding: 24px;
    box-sizing: border-box; box-shadow: none;
}
.comment-form h3 { font-size: 20px; margin: 0 0 16px; }
.comment-form .tox-tinymce {
    border: 1px solid var(--border-color) !important; border-radius: 10px; overflow: hidden; min-height: 180px;
}
.comment-form .btn-submit {
    display: inline-block; width: auto; margin-top: 16px; padding: 10px 28px; border-radius: 999px;
}
@media (max-width: 576px) {
    .comments-list { padding: 4px 16px !important; }
    .form-container.comment-form { padding: 16px; }
    .comment-form .btn-submit { width: 100%; }
}

/* =========================================
   Адаптив: глобальные правила (v8)
========================================= */
img, video, iframe, embed { max-width: 100%; }
.logo img { max-width: none; flex-shrink: 0; } /* лого не схлопывать в flex-шапке */
img { height: auto; }
.content, .content-main, .post-content, h1, h2, h3, h4 { overflow-wrap: anywhere; }
.content-main, .main-wrapper > * { min-width: 0; }

@media (max-width: 992px) {
    .nav-menu.open {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }
    .nav-menu.open li { width: 100%; }
    .nav-menu.open li a { display: flex; align-items: center; min-height: 44px; }
    .nav-menu.open .nav-dropdown-menu {
        position: static; min-width: 0; width: 100%;
        opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; display: none;
        padding-left: 15px;
    }
    .nav-menu.open .nav-dropdown.open > .nav-dropdown-menu { display: block; }
    .nav-menu.open .nav-dropdown:hover .nav-dropdown-menu { transform: none; }
    .nav-dropdown-menu { max-width: calc(100vw - 20px); }
    /* touch: открытие по клику (.open) */
    .sidebar-dropdown:hover .sidebar-submenu { display: none; animation: none; }
    .sidebar-dropdown.open .sidebar-submenu { display: block; animation: fadeIn 0.3s ease; }
    .sidebar { width: 100%; max-width: 100%; }
    .sidebar a { min-height: 44px; }
}
.nav-dropdown.open > .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 768px) {
    .post-card { flex-direction: column; }
    .post-author {
        width: 100%; border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .content table { display: block; max-width: 100%; overflow-x: auto; }
    .form-container { padding: 25px 20px; }
}

@media (max-width: 414px) {
    .container { padding: 0 14px; }
    .form-container { padding: 20px 15px; max-width: 100%; }
    .form-container .btn, .form-container button, .form-container input[type=submit] { width: 100%; }
    input, select, textarea { font-size: 16px !important; max-width: 100%; }
    .btn { padding-left: 16px; padding-right: 16px; }
    .post-content, .post-author { padding: 14px; }
    .table th, .table td { padding: 10px 12px; }
    h1 { font-size: 24px; }
    h2 { font-size: 21px; }
    h3 { font-size: 18px; }
}

/* --- шапка: фикс регрессий v9 --- */
.logo { flex-shrink: 0; }
.navbar-container > nav { min-width: 0; }
.nav-menu { flex-wrap: nowrap; gap: 4px 12px; }
.nav-menu > li { flex: 0 0 auto; }
.nav-menu > li > a { display: block; white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 992px) {
    .navbar-container > nav { flex: 0 0 auto; }
    .nav-auth { margin-left: auto; align-items: center; gap: 8px; }
    .nav-auth .has-icon {
        width: 40px; height: 40px; padding: 0; justify-content: center;
        border-radius: 50%; font-size: 16px; box-sizing: border-box;
    }
    .nav-auth .has-icon span { display: none; }
    .burger-toggle {
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; padding: 0; margin-left: 0;
        font-size: 20px; box-sizing: border-box;
    }
}
@media (min-width: 993px) {
    .navbar-container.container { max-width: 1600px; padding-left: 20px; padding-right: 20px; }
    .nav-menu { gap: 0 4px; }
}
@media (min-width: 993px) and (max-width: 1500px) {
    .navbar-container { gap: 8px; }
    .nav-menu > li > a { font-size: 14px; padding: 8px 8px; }
    .nav-auth .has-icon span { display: none; }
    .nav-auth .has-icon { padding: 8px 11px; }
}
.navbar-container { padding-left: 20px; padding-right: 20px; }
@media (max-width: 414px) { .navbar-container { padding-left: 14px; padding-right: 14px; } }

/* --- контент постов v10 --- */
.news-text,
.post-content,
.cont > .text {
    overflow-wrap: anywhere;
    word-wrap: break-word;
    min-width: 0;
    display: flow-root;
}
.news-text p, .post-content p, .cont > .text p { margin-bottom: 0.8em; }
.news-text ol, .news-text ul,
.post-content ol, .post-content ul,
.cont > .text ol, .cont > .text ul {
    padding-left: 1.8em;
    margin: 0 0 0.8em;
    list-style-position: outside;
}
.news-text ol, .post-content ol, .cont > .text ol { list-style-type: decimal; }
.news-text ul, .post-content ul, .cont > .text ul { list-style-type: disc; }
.news-text li, .post-content li, .cont > .text li { margin-bottom: 0.3em; }
.news-text blockquote, .post-content blockquote, .cont > .text blockquote {
    margin: 0 0 0.8em;
    padding: 8px 0 8px 16px;
    border-left: 3px solid var(--border-color);
    max-width: 100%;
}
.news-text pre, .post-content pre, .cont > .text pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
}
.news-text table, .post-content table, .cont > .text table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
.news-text img, .post-content img, .cont > .text img { max-width: 100%; height: auto; }
.news-text img:not([align]):not([style*="float"]):not([style*="margin"]):not([style*="display"]),
.post-content img:not([align]):not([style*="float"]):not([style*="margin"]):not([style*="display"]),
.cont > .text:not(.gallery-item) img:not([align]):not([style*="float"]):not([style*="margin"]):not([style*="display"]) {
    float: none;
    display: block;
    max-width: min(100%, 480px);
    height: auto;
    margin: 0 0 18px;
    border-radius: var(--border-radius);
}
.cont .file img, .post-content .file img { float: none !important; max-width: none !important; margin: 0 !important; border-radius: 0 !important; display: inline !important; }

/* --- форум v12 --- */
.forum { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); overflow: hidden; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.forum > .title { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 16px; color: var(--primary-dark); }
.forum > .title .forumRight { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12px; color: var(--text-muted); }
.forumItem { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border-color); transition: background 0.2s; }
.forumItem:last-child { border-bottom: none; }
.forumItem:hover { background: var(--bg-color); }
.forumLeft { position: relative; flex: 1 1 auto; min-width: 0; padding-left: 56px; }
.forumLeft .img { position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--bg-color); color: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.forumLink { font-weight: 600; font-size: 16px; color: var(--primary-color); text-decoration: none; }
.forumLink:hover { color: var(--primary-dark); text-decoration: underline; }
.forumLeft p { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.forumLeft p.author a { color: var(--primary-color); }
.forumRight { display: flex; flex: 0 0 auto; gap: 8px; text-align: center; }
.forumRight .ntheme, .forumRight .nmess { width: 90px; }
.forumRight .act { width: 200px; text-align: left; }
.forumItem .forumRight .ntheme, .forumItem .forumRight .nmess { font-size: 16px; font-weight: 600; color: var(--text-main); }
.forumItem .forumRight .act { font-size: 13px; color: var(--text-muted); }
.noForum { padding: 20px; color: var(--text-muted); }
.forumItem:has(> .forumPost) { display: block; padding: 0; }
.forumPost { display: grid; grid-template-columns: 50px minmax(0, 1fr); column-gap: 16px; align-items: start; width: 100%; box-sizing: border-box; padding: 20px 24px; min-width: 0; }
.forumPost > * { grid-column: 2; min-width: 0; }
.forumPost .img { grid-column: 1; grid-row: 1 / span 5; width: 50px; height: 50px; flex: 0 0 50px; border-radius: 50%; overflow: hidden; background: var(--bg-color); }
.forumPost .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.forumTop { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; width: 100%; }
.forumTop .author { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--primary-color); text-decoration: none; overflow-wrap: anywhere; }
.forumTop .date { flex: 0 0 auto; margin-left: auto; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.postTitle { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 18px; margin-bottom: 8px; }
.postText { overflow-wrap: anywhere; line-height: 1.6; }
.postText img { max-width: 100%; height: auto; }
.postText blockquote { margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--primary-light); background: var(--bg-color); border-radius: 6px; }
.forumBottom { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 12px; width: 100%; font-size: 16px; }
.forumBottom a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; color: var(--text-muted); transition: color 0.2s; }
.forumBottom a:hover { color: var(--accent-color); }
@media (max-width: 768px) {
    .forum > .title .forumRight { display: none; }
    .forumItem { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
    .forumRight { flex-wrap: wrap; justify-content: flex-start; gap: 4px 16px; padding-left: 56px; text-align: left; }
    .forumRight .ntheme, .forumRight .nmess, .forumRight .act { width: auto; font-size: 13px !important; font-weight: 400 !important; }
    .forumRight .ntheme::before { content: "Темы: "; }
    .forumRight .nmess::before { content: "Сообщения: "; }
    .forumRight .act { flex-basis: 100%; }
}
@media (max-width: 576px) {
    .forumPost { grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; padding: 14px; }
    .forumPost .img { width: 40px; height: 40px; flex-basis: 40px; }
    .forumTop { flex-wrap: wrap; gap: 2px 12px; }
    .forumTop .author { flex: 1 1 100%; }
    .forumTop .date { margin-left: 0; }
}

/* --- документы и профиль v14 --- */
.docsCats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.docsCats a {
    display: inline-flex; align-items: center; padding: 7px 14px;
    border: 1px solid var(--border-color); border-radius: 999px;
    background: var(--card-bg); color: var(--text-main); font-size: 14px;
    text-decoration: none; transition: var(--transition);
}
.docsCats a:hover, .docsCats a.active, .docsCats a.act {
    background: var(--primary-color); border-color: var(--primary-color); color: #fff;
}

.cont > .text.profile {
    display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 32px; align-items: start;
}
.profile .ava { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.profile .ava > img {
    width: 160px; height: 160px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--border-color); background: var(--bg-color);
}
.profile .ava > a { position: absolute; top: 0; right: 8px; color: var(--text-muted); }
.profile .ava > a:hover { color: #c0392b; }
.profile .ava form { margin: 0; }
.profile #myfotolabel {
    display: inline-flex; align-items: center; padding: 7px 16px; cursor: pointer;
    border: 1px solid var(--primary-color); border-radius: 999px; color: var(--primary-color);
    font-size: 14px; transition: var(--transition);
}
.profile #myfotolabel:hover { background: var(--primary-color); color: #fff; }
.profile #myfoto { display: none; }
.profile .pf-main { min-width: 0; }
.profile .pf-main p { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border-color); line-height: 1.5; }
.profile .pf-main p.pf-name { font-size: 24px; font-weight: 700; border-bottom: 0; padding-top: 0; }
.profile .pf-label { display: inline-block; min-width: 150px; margin-right: 8px; font-weight: 400; font-size: 13px; color: var(--text-muted); }
.profile .pf-main p span { color: var(--text-main); }
.profile .pf-main span.pf-ok {
    display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px;
    background: #e3f4ea; color: var(--primary-color); font-size: 13px;
}
.profile .pf-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; }
.profile .pf-links li { list-style: none; margin: 0; }
.profile .pf-links a {
    display: inline-flex; padding: 7px 14px; border: 1px solid var(--border-color); border-radius: 999px;
    background: var(--card-bg); color: var(--text-main); font-size: 14px; text-decoration: none; transition: var(--transition);
}
.profile .pf-links a:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.profile .editlink {
    display: inline-flex; margin-top: 16px; padding: 9px 22px; border-radius: 999px;
    background: var(--primary-color); color: #fff; text-decoration: none; transition: var(--transition);
}
.profile .editlink:hover { background: var(--primary-dark); }
@media (max-width: 768px) {
    .cont > .text.profile { grid-template-columns: 1fr; }
    .profile .ava { align-items: flex-start; }
    .profile .ava > a { left: 120px; right: auto; }
    .profile .pf-label { display: block; min-width: 0; margin: 0; }
}
.cont > .text.profile .ava > img { height: 160px; max-width: none; }
.cont > .text.profile ul.pf-links { padding-left: 0; list-style: none; margin: 0 0 12px; }
.cont > .text.profile .pf-links li { margin: 0; }
.cont > .text.profile { overflow-wrap: break-word; }
.cont > .text.profile .pf-name { overflow-wrap: normal; word-break: normal; }
@media (max-width: 768px) {
    .cont > .text.profile .pf-name { overflow-wrap: break-word; font-size: 20px; }
}

/* долги и СМС-подтверждение (v14) */
.cont > table { width: 100%; border-collapse: collapse; margin-top: 12px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cont > table thead, .cont > table tbody, .cont > table tfoot { display: table; width: 100%; table-layout: auto; }
.cont > table th, .cont > table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); text-align: right; white-space: nowrap; font-size: 14px; }
.cont > table th { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.cont > table th:first-child, .cont > table td:first-child { text-align: left; }
.cont > table tfoot td { font-weight: 700; border-top: 2px solid var(--border-color); border-bottom: 0; }
.cont > table tfoot td[colspan] { text-align: left; }

.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .5); align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal.modal-open { display: flex; }
.modal .modal-dialog { width: 100%; max-width: 420px; }
.modal .modal-content { position: relative; padding: 20px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.modal .modal-title { margin: 0 40px 16px 0; font-size: 20px; }
.modal .close {
    position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 22px; line-height: 1; color: var(--text-muted); text-decoration: none;
}
.modal .close:hover { background: var(--bg-color); color: var(--text-main); }
.modal .modal-body > div { margin: 10px 0 14px; color: var(--text-muted); font-size: 14px; }
.modal #smscode {
    display: block; width: 100%; padding: 10px 12px; font-size: 18px; text-align: center; letter-spacing: 6px;
    border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg);
}
.modal #smscode:focus { outline: none; border-color: var(--primary-color); }
.modal .modal-body input.button { display: inline-block; width: auto; margin: 0 10px 0 0; padding: 10px 20px; border: 1px solid var(--primary-color); border-radius: 999px; background: var(--primary-color); color: #fff; cursor: pointer; font-size: 14px; }
.modal .modal-body input#repitcode { background: transparent; color: var(--primary-color); margin-right: 0; }
.modal .modal-body input.disabled, .modal .modal-body input:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 400px) {
    .modal .modal-body input.button { display: block; width: 100%; margin: 0 0 10px; }
}
.modal .modal-body input#repitcode.button { background: transparent; color: var(--primary-color) !important; }
.modal .modal-body input#repitcode.button:not(:disabled):hover { background: var(--primary-color); color: #fff !important; }
.modal .modal-body br { display: none; }

/* --- комментарии v15 --- */
.comments-head { margin: 24px 0 0 !important; padding-bottom: 10px; }
.comments-head .subpage-title { margin: 0; }
.comments-list { padding: 4px 24px !important; margin-top: 16px; }
.comments-list + .pagination:empty { display: none; }
.comments-list + .pagination { margin: 16px 0 0; }
.comm { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; padding: 16px 0; }
.comm:last-child { border-bottom: none; }
.comm .img img { display: block; }
.comm .comment { min-width: 0; }
.comm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }
.comm-head .author { margin: 0; color: var(--primary-color); }
.comm-head .date { margin: 0; color: var(--text-muted); }
.comment p:last-child { margin-bottom: 0; }

.form-container.comment-form {
    max-width: none; width: 100%; margin: 24px 0 0; padding: 24px;
    box-sizing: border-box; box-shadow: none;
}
.comment-form h3 { font-size: 20px; margin: 0 0 16px; }
.comment-form .tox-tinymce {
    border: 1px solid var(--border-color) !important; border-radius: 10px; overflow: hidden; min-height: 180px;
}
.comment-form .btn-submit {
    display: inline-block; width: auto; margin-top: 16px; padding: 10px 28px; border-radius: 999px;
}
@media (max-width: 576px) {
    .comments-list { padding: 4px 16px !important; }
    .form-container.comment-form { padding: 16px; }
    .comment-form .btn-submit { width: 100%; }
}
