/* ========================================
   NOVA SAPIENS UNIFIED CSS
   Унифицированные стили для всей платформы
   ======================================== */

/* ===== CSS VARIABLES ===== */
:root {
    --primary-dark: #2c3e50;
    --primary-light: #34495e;
    --accent-blue: #3498db;
    --accent-green: #27ae60;
    --accent-orange: #f39c12;
    --accent-purple: #667eea;
    --text-gray: #6c757d;
    --bg-light: #f8f9fa;
    --border-light: #e9ecef;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--primary-dark);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ===== NAVIGATION STYLES ===== */
.navigation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: static;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-brand {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.nav-brand h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.nav-stats {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-stat-item {
    background: rgba(255,255,255,0.15);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.nav-stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.nav-stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.nav-login .nav-stat-label {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Login Button */
.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-btn:enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== МИНИМАЛИСТИЧНЫЕ СТИЛИ НАВИГАЦИОННЫХ КНОПОК ===== */
/* Единый современный стиль для Генерации и Избранное */
.generations-btn,
.favorites-btn {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: none;
}

.generations-btn:hover,
.favorites-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ===== MAIN CONTENT AREA ===== */
.main-content {
    min-height: calc(100vh - 180px);
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Узкая ширина для страниц исследований (не затрагивает каталог) */
.main-container:has(.research-header),
.main-container:has(.back-navigation) {
    max-width: 960px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0; /* Убраны горизонтальные отступы */
}

/* ===== RESEARCH PAGE SPECIFIC STYLES ===== */
.back-navigation {
    margin-bottom: 30px;
}

.back-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.research-header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
}

.research-meta {
    margin-top: 20px;
}

.meta-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-top: 15px;
}

.meta-label {
    font-weight: 600;
    color: var(--text-gray);
    font-size: 0.9em;
}

.meta-value {
    color: var(--primary-dark);
    font-weight: 500;
}

.key-result-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-green);
    width: 100%;
    display: block;
}

.key-result-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.key-result-text {
    color: #064e3b;
    line-height: 1.6;
    font-size: 1.05em;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5e8 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-green);
    margin-bottom: 20px;
}

.categories-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.categories-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.roles-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.roles-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.research-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.research-content h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.content-wrapper {
    line-height: 1.7;
    color: var(--primary-dark);
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4,
.content-wrapper h5,
.content-wrapper h6 {
    color: var(--primary-dark);
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.content-wrapper h1 { font-size: 1.8em; }
.content-wrapper h2 { font-size: 1.5em; }
.content-wrapper h3 { font-size: 1.3em; }
.content-wrapper h4 { font-size: 1.1em; }

.content-wrapper p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.content-wrapper ul,
.content-wrapper ol {
    margin: 15px 0;
    padding-left: 20px;
}

.content-wrapper li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.content-wrapper a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

.content-wrapper a:hover {
    color: #5a67d8;
    text-decoration: underline;
}



.pdf-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    width: 100%;
    display: block;
}

.pdf-block {
    text-align: center;
}

.pdf-block h3 {
    color: var(--primary-dark);
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
}

.pdf-link-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.pdf-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    text-decoration: none;
}

/* ===== MODAL STYLES ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
}

.modal-header {
    padding: 20px 30px 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    color: var(--primary-dark);
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: var(--primary-dark);
}

.modal-body {
    padding: 20px 30px 30px 30px;
}

/* ===== AUTH POPUP STYLES ===== */
.nova-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.auth-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.auth-popup-content {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 2001;
}

.auth-popup-header {
    padding: 25px 30px 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
}

.auth-popup-header h3 {
    color: var(--primary-dark);
    font-size: 1.4em;
    font-weight: 600;
    margin: 0;
}

.auth-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auth-popup-close:hover {
    background: #f8f9fa;
    color: var(--primary-dark);
}

.auth-popup-body {
    padding: 30px;
}

.auth-info h4 {
    color: var(--primary-dark);
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
}

.auth-info p {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.auth-benefits {
    margin: 20px 0;
}

.auth-benefit {
    color: var(--primary-dark);
    padding: 8px 0;
    font-size: 0.95em;
}

.auth-widget {
    margin-top: 25px;
    text-align: center;
}

.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== COPY NOTIFICATION ===== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RESEARCH PAGE STYLES ===== */
.header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
}

.breadcrumb {
    font-size: 0.9em;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.research-title {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
    line-height: 1.3;
}

.research-title-en {
    font-size: 1.2em;
    color: #718096;
    margin-bottom: 25px;
    font-style: italic;
}



.meta-info-compact {
    flex: 1;
}

.meta-details {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.95em;
    color: var(--text-gray);
}

.separator {
    color: #ccc;
}

.pdf-link-simple {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.pdf-link-simple:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Rating Display */
.rating-large {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    border: 2px solid var(--border-light);
    min-width: 120px;
}

.rating-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Rating Colors */
.rating-low { border-color: #e74c3c; background: #fdf2f2; }
.rating-medium { border-color: var(--accent-orange); background: #fef9f0; }
.rating-good { border-color: var(--accent-green); background: #f0f9f4; }
.rating-excellent { border-color: var(--accent-purple); background: #f7f5ff; }

/* Meta Grid */
.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.meta-item {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
}

.meta-item.key-result {
    border-left: 4px solid var(--accent-green);
}





/* Categories Section */
.categories-compact {
    margin-bottom: 30px;
}

.categories-row {
    margin-bottom: 20px;
}

.category-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.category-group {
    margin-bottom: 15px;
}

.category-group h4 {
    margin: 0 0 10px 0;
    color: var(--primary-dark);
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.category-tag {
    background: var(--border-light);
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.category-tag:hover {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-1px);
}

.category-tag.main {
    background: var(--accent-purple);
    color: white;
    font-weight: 600;
    border: 1px solid #5a6fd8;
}



.roles-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary-dark);
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.role-tag-clickable {
    background: var(--bg-light);
    color: #495057;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    user-select: none;
}

.role-tag-clickable:hover {
    background: #17a2b8;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* Content Section */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 30px;
}

.content-container {
    line-height: 1.7;
    font-size: 1.05em;
}

.content-container h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    margin: 30px 0 15px 0;
    font-weight: 600;
}

.content-container h3 {
    color: var(--primary-dark);
    font-size: 1.3em;
    margin: 25px 0 12px 0;
    font-weight: 600;
}

.content-container p {
    margin-bottom: 15px;
    color: #4a5568;
}

.content-container ul, .content-container ol {
    margin: 15px 0;
    padding-left: 25px;
}

.content-container li {
    margin-bottom: 8px;
}

/* Code Blocks */


.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
}

.copy-btn.copied {
    background: var(--accent-green);
    color: white;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.role-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .role-modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-content {
    padding: 20px 25px;
}

.modal-content p {
    margin: 0;
    line-height: 1.6;
    color: #4a5568;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.modal-btn {
    background: var(--accent-purple);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Footer Styles - СОВРЕМЕННЫЙ ДИЗАЙН */
.page-footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 50%, #34495e 100%);
    color: white;
    padding: calc(var(--spacing-xl) * 1.5) 0 var(--spacing-xl);
    margin-top: calc(var(--spacing-xl) * 2);
    position: relative;
    overflow: hidden;
}

.page-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
}

.footer-info {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.footer-info p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.footer-info p:first-child {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.footer-info p:nth-child(2) {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.footer-cta {
    margin: 0;
    display: flex;
    justify-content: center;
}

.telegram-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.telegram-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.telegram-cta:hover::before {
    left: 100%;
}

.telegram-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Адаптивность футера */
@media (max-width: 768px) {
    .page-footer {
        padding: var(--spacing-xl) 0 var(--spacing-lg);
        margin-top: var(--spacing-xl);
    }
    
    .footer-info {
        padding: 0 var(--spacing-md);
        gap: var(--spacing-md);
    }
    
    .telegram-cta {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.9rem;
    }
}

/* Старые стили для совместимости */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    padding: var(--spacing-xs) 0;
}

.footer-link:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Action Buttons */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-purple);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.back-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===== CATALOG STYLES ===== */

/* Header Controls */
.header-controls {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.control-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary-dark);
    white-space: nowrap;
}

/* Search Components */
.search-container {
    position: relative;
    display: flex;
    gap: 8px;
}

.search-input {
    width: 250px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.clear-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    opacity: 1;
}

.clear-btn:disabled {
    display: none;
}

.control-select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    min-width: 120px;
    cursor: pointer;
}

.mobile-filters-btn {
    display: none;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Main Layout */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 200px);
}

/* Sidebar - АККУРАТНАЯ ГОРИЗОНТАЛЬНАЯ ПОЛОСА С STICKY ПОВЕДЕНИЕМ */
.sidebar {
    width: 100%;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) var(--spacing-lg);
    overflow: visible; /* Убрали прокрутку, разрешили тултипы */
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap; /* Разрешили перенос на узких экранах */
    min-height: 60px;
    /* Sticky поведение */
    position: sticky;
    top: 0;
    z-index: 100; /* Поверх контента */
    transition: box-shadow 0.3s ease; /* Плавная анимация тени */
}

/* Тень при прилипании (опционально для визуального эффекта) */
.sidebar.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.sidebar-header h2 {
    font-size: 1.2em;
    color: var(--primary-dark);
    margin: 0;
}

.close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-gray);
}

/* 🎯 МОБИЛЬНЫЕ ЭЛЕМЕНТЫ SIDEBAR - скрыты на десктопе */
.sidebar-mobile-header {
    display: none;
}

.sidebar-title {
    display: none;
}

.sidebar-close-btn {
    display: none; /* Скрыта на десктопе по умолчанию */
}

/* Filter Components - РАСТЯНУТЫЕ НА ВСЮ ШИРИНУ */
.filter-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
    position: relative;
}

/* Кнопка сброса не растягивается */
.filter-group:has(.reset-btn) {
    flex: none;
    min-width: auto;
}

.filter-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.filter-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    white-space: nowrap;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* ========== RATING FILTER STYLES - РАСКРЫВАЮЩИЙСЯ ========== */
.rating-filter-group {
    flex: 1;
    min-width: 180px;
    position: relative; /* Для позиционирования dropdown */
}

/* Компактный заголовок-кнопка */
.rating-selection-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.rating-selection-display:hover {
    border-color: var(--accent-blue);
    background: var(--bg-light);
}

.rating-selection-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-dark);
    white-space: nowrap;
}

.rating-reset-btn-inline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rating-reset-btn-inline:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.rating-selection-display .toggle-icon {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

/* Раскрывающееся содержимое */
.rating-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    animation: slideDown 0.2s ease;
}

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

.rating-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rating-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.rating-input-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.rating-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    transition: border-color 0.2s ease;
}

.rating-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.rating-separator {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 16px;
}

.rating-slider-container {
    position: relative;
    height: 40px;
    margin-bottom: 12px;
}

.rating-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    cursor: pointer;
    pointer-events: all;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.rating-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.rating-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    cursor: pointer;
    pointer-events: all;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.rating-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.rating-slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    pointer-events: none;
}

.rating-slider-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--accent-blue) 100%);
    border-radius: 3px;
    transition: left 0.1s ease, width 0.1s ease;
}

/* Month Filter Specific - РАСТЯНУТЫЙ НА ВСЮ ШИРИНУ */
.month-filter-container {
    width: 100%;
}

.month-selection-display {
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: border-color 0.3s;
    width: 100%;
    font-size: 0.9rem;
    white-space: nowrap;
}

.month-selection-text {
    flex: 1; /* Займет все доступное место слева */
}

.month-count {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    margin-right: var(--spacing-xs); /* Отступ от иконки */
}

.month-selection-display:hover {
    border-color: var(--accent-blue);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

/* Month Dropdown - ГОРИЗОНТАЛЬНЫЙ ПОЗИЦИОНИНГ */
.month-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 280px; /* Увеличена ширина для длинных названий месяцев */
    margin-top: 4px;
    max-width: calc(100vw - 40px); /* Не превышаем ширину экрана */
}

.month-checkboxes {
    margin-top: 0;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0; /* Убираем внутренние отступы для кнопок */
    max-height: 300px;
    overflow-y: auto; /* Вертикальная прокрутка при превышении высоты */
    overflow-x: hidden; /* Скрываем горизонтальную прокрутку */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Каждый месяц - отдельная строка */
.month-checkbox {
    display: block !important;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
    transition: background-color 0.2s;
    word-wrap: break-word; /* Перенос длинных слов */
    overflow-wrap: break-word; /* Современный синтаксис */
    white-space: nowrap; /* Предотвращаем перенос строк */
    text-overflow: ellipsis; /* Многоточие для очень длинных названий */
    overflow: hidden; /* Скрываем переполнение */
}

.month-checkbox:hover {
    background-color: var(--bg-light);
    border-radius: 4px;
}

.month-checkbox input {
    margin-right: var(--spacing-sm);
}

.month-checkbox span {
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Адаптивные стили для месячного фильтра */
@media (max-width: 768px) {
    .month-dropdown {
        width: calc(100vw - 20px); /* На мобильных занимаем почти всю ширину */
        left: -10px; /* Центрируем относительно родителя */
        max-width: 320px;
    }
    
    .month-checkboxes {
        max-height: 250px; /* Уменьшаем высоту на мобильных */
    }
    
    .month-checkbox {
        padding: 12px var(--spacing-md); /* Увеличиваем отступы для удобства тапа */
        font-size: 0.95rem;
    }
    
    .month-checkbox span {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .month-dropdown {
        width: calc(100vw - 10px);
        left: -5px;
    }
    
    .month-checkboxes {
        max-height: 200px; /* Еще меньше на очень маленьких экранах */
        padding: 5px;
    }
    
    .month-checkbox {
        padding: 10px;
        margin-bottom: 2px;
    }
}

/* 🎯 КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ для iPhone 12 Pro (390px) и подобных */
@media (max-width: 390px) {
    /* Гарантируем отсутствие горизонтального overflow */
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .header, .navigation {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Карточки исследований - никакого overflow */
    .research-card {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        margin: 0 auto !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    
    .research-grid {
        padding: 0 10px !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .content-area {
        padding: 10px 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Фильтры в header - компактно */
    .header-controls {
        padding: 0 10px !important;
    }
    
    .control-select {
        font-size: 0.8rem !important;
        padding: 6px 8px !important;
    }
    
    .access-checkbox-header {
        padding: 6px 4px !important;
        font-size: 0.75rem !important;
    }
    
    /* Счетчики */
    .filter-results-count {
        font-size: 0.85rem !important;
    }
    
    /* Заголовки карточек */
    .card-title {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
    }
    
    /* Футер карточки */
    .card-footer {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    
    /* Кнопка избранного компактнее */
    .favorite-btn-catalog {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
}



/* Контейнер кнопок управления месяцами */
.month-controls {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: white;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--spacing-xs);
}

/* Современные кнопки управления месяцами */
.month-control-btn {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.month-control-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.month-control-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.month-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.month-filter-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.month-action-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 3px;
    display: inline-block;
}

/* Filter Actions */
.filter-actions {
    margin-top: var(--spacing-lg);
}

/* КОМПАКТНАЯ КНОПКА СБРОСА - ТОЛЬКО ИКОНКА НА ДЕСКТОПЕ */
.reset-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #94a3b8;
    color: white;
    border: none;
    border-radius: 50%;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    transform: scale(1.1);
}

/* На десктопе показываем только иконку */
.reset-text {
    display: none; /* Скрыт на десктопе */
}

.reset-icon {
    display: inline-block;
}

/* Тултип для кнопки сброса на десктопе */
.reset-btn::after {
    content: "Сбросить все фильтры";
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.reset-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Content Area - ГАРМОНИЗИРОВАННЫЕ ОТСТУПЫ */
.content-area {
    flex: 1;
    padding: var(--spacing-lg) 0; /* Убираем левый и правый отступы */
    overflow-y: auto;
}

.results-summary {
    margin-bottom: var(--spacing-lg);
}

.results-count {
    font-size: 1.1rem;
    color: var(--primary-light);
    font-weight: 500;
    margin: 0;
}

/* Счетчик результатов в header */
.filter-results-count.header-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: var(--spacing-lg);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-light);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

/* Header стили для правильного выравнивания */
.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: 20px; /* Отступ снизу */
}

.header-left h1 {
    margin: 0;
    font-size: 1.5rem;
}

/* Research Grid - ОБНОВЛЕННАЯ СЕТКА: 2 КОЛОНКИ */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: var(--spacing-lg);
    margin: 0; /* Убираем лишние отступы для примыкания к краям */
    margin-top: 0px; /* Убран отступ сверху для примыкания к sidebar */
}

.research-card {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    width: 100%;
}

.research-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.research-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 24px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.research-card .key-result {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    line-height: 1.4;
    padding-left: 0;
}

.research-card .category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.research-card .category-tag {
    background: var(--border-light);
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.research-card .card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-light);
}

.research-card .card-footer .date {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.research-card .card-footer .rating {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* === СТИЛИ ДЛЯ СТРУКТУРЫ КАРТОЧЕК ИЗ NOVA-MODERN.JS === */
/* Новый card-header для размещения заголовка и рейтинга */
.research-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: var(--spacing-sm);
}

.research-card .card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.research-card .card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.research-card .card-title a:hover {
    color: var(--accent-green);
}

.research-card .key-result-preview {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    line-height: 1.4;
    padding-left: 0;
}

.research-card .card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.research-card .card-date {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* Рейтинг в card-header (правый верхний угол) */
.research-card .card-header .card-rating {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.research-card .card-rating.excellent {
    background-color: #fff8e1;
    color: #ff8f00;
    border: 1px solid #ffcc02;
}

.research-card .card-rating.good {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #42a5f5;
}

.research-card .card-rating.medium {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.research-card .card-rating.low {
    background-color: #f5f7fa;
    color: #6b7280;
    border: 1px solid #9ca3af;
}

/* Кнопка "В избранное" в каталоге - менее яркая */
.favorite-btn-catalog {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.favorite-btn-catalog:hover {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a1a;
    border-color: #ffd700;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.favorite-btn-catalog:active {
    transform: translateY(0);
}

.favorite-btn-catalog.in-favorites {
    background: linear-gradient(135deg, #4CAF50 0%, #66bb6a 100%);
    color: white;
    border-color: #4CAF50;
}

.favorite-btn-catalog.in-favorites:hover {
    background: linear-gradient(135deg, #66bb6a 0%, #81c784 100%);
}

/* Обновляем card-footer: дата слева, кнопка справа */
.research-card .card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-light);
    gap: 12px;
}

/* Pagination - СОВРЕМЕННЫЙ UX - ПОЛНАЯ ШИРИНА */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: 20px; /* Фиксированный отступ сверху */
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--border-light);
    width: 100%; /* Полная ширина как у research-grid */
    box-sizing: border-box;
}

/* Основной контейнер пагинации */
#pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    margin-top: 20px; /* Отступ сверху */
}

/* Контролы пагинации (кнопки навигации) */
.pagination-controls {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    background: white;
    padding: var(--spacing-sm);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%; /* Растягиваем на всю ширину */
    max-width: none; /* Убираем ограничения ширины */
}

.pagination-controls button {
    min-width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.pagination-controls button.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #4c9eff 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.pagination-controls button:disabled:hover {
    background: transparent;
    transform: none;
}

/* Разделители в пагинации */
.pagination-controls span {
    color: var(--text-secondary);
    padding: 0 var(--spacing-xs);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Селектор количества элементов */
.items-per-page {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.items-per-page label {
    font-weight: 500;
    white-space: nowrap;
}

.items-per-page select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: white;
    color: var(--primary-dark);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.items-per-page select:hover {
    border-color: var(--accent-blue);
}

.items-per-page select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Мобильная адаптивность */
@media (max-width: 768px) {
    .pagination-controls {
        gap: var(--spacing-xs);
        padding: var(--spacing-xs);
    }
    
    .pagination-controls button {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .items-per-page {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .nav-stats {
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    /* 🎯 СКРЫВАЕМ СЧЕТЧИКИ на планшетах для экономии места */
    .nav-stat-item {
        display: none !important;
    }
    
    .nav-brand h1 {
        font-size: 1.6rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .research-title {
        font-size: 1.8em;
    }
    
    .meta-info-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .rating-large {
        align-self: flex-start;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    /* Mobile Catalog Styles - АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ ≤768px */
    
    /* 🎯 СКРЫВАЕМ LABELS для планшетов */
    .control-label {
        display: none !important;
    }
    
    .header-controls {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* 2 равные колонки */
        gap: 12px;
        width: 100%;
    }
    
    /* 🎯 control-group с вертикальным flex */
    .header-controls > .control-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px;
        width: 100%;
    }
    
    /* Строка 1: FREE/PRO на всю ширину */
    .header-controls > .control-group:nth-child(1) {
        grid-column: 1 / -1 !important; /* На обе колонки */
    }
    
    /* Строка 2: Селект "По дате" - первая колонка */
    .header-controls > .control-group:nth-child(2) {
        grid-column: 1 / 2 !important; /* Первая колонка */
    }
    
    /* Строка 2: Селект "По убыванию" - вторая колонка */
    .header-controls > .control-group:nth-child(3) {
        grid-column: 2 / 3 !important; /* Вторая колонка */
    }
    
    /* Строка 3: КНОПКА "ВСЕ ФИЛЬТРЫ" - на всю ширину внизу */
    .header-controls > .mobile-filters-btn {
        grid-column: 1 / -1 !important; /* На обе колонки */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
        font-weight: 500;
    }
    
    .mobile-filters-icon {
        font-size: 1.2rem;
    }
    
    .mobile-filters-text {
        font-size: 1rem;
    }
    
    /* Селекты на всю ширину своих control-group */
    .control-select {
        width: 100%;
        min-width: 0;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%; /* Не на всю ширину, 85% от экрана */
        max-width: 360px; /* Максимальная ширина */
        height: 100vh;
        z-index: 1001; /* Выше overlay */
        transition: left 0.3s ease;
        overflow-y: auto;
        background: white;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        padding: 16px 12px; /* Компактный padding для мобильного */
        
        /* 🎯 КЛЮЧЕВЫЕ СТИЛИ для вертикального списка фильтров */
        display: flex !important;
        flex-direction: column !important; /* Вертикальная колонка */
        flex-wrap: nowrap !important; /* Запрет переноса */
        align-items: stretch !important; /* Растягиваем фильтры на всю ширину */
        gap: 12px !important; /* Фиксированный отступ между фильтрами */
    }
    
    .sidebar.show {
        left: 0;
    }
    
    /* 🎯 МОБИЛЬНЫЕ ЭЛЕМЕНТЫ - показываем только на мобильном */
    .sidebar-mobile-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 8px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--border-light);
    }
    
    .sidebar-title {
        display: block;
        font-size: 18px;
        font-weight: 600;
        color: var(--primary-dark);
        margin: 0;
    }
    
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: var(--bg-light);
        border: 2px solid var(--border-light);
        border-radius: 50%;
        font-size: 20px;
        line-height: 1;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0; /* Не сжимается */
    }
    
    .sidebar-close-btn:hover {
        background: white;
        border-color: var(--primary-dark);
        color: var(--primary-dark);
        transform: rotate(90deg);
    }
    
    .sidebar-close-btn:active {
        transform: rotate(90deg) scale(0.95);
    }
    
    /* Overlay для затемнения фона */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1000; /* Ниже sidebar */
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    @media (max-width: 768px) {
        .sidebar-overlay.show {
            display: block;
            opacity: 1;
        }
    }
    
    .close-btn {
        display: block;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
    }
    
    .search-input {
        width: 100%;
    }
    
    .content-area {
        padding: var(--spacing-md) 0; /* Убираем левый и правый отступы на мобильных */
    }
    
    /* 🎯 ВСЕ ФИЛЬТРЫ на мобильном - полная ширина, вертикальный стек */
    .filter-group {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important; /* Не растягиваем, не сжимаем */
        margin: 0 !important;
    }
    
    .filter-select {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* 🎯 КНОПКА СБРОСА на мобильном - с текстом */
    .reset-btn {
        width: 100% !important; /* Полная ширина */
        height: auto !important;
        padding: 10px 16px !important;
        border-radius: 8px !important; /* Не круглая, а прямоугольная */
        justify-content: center !important;
        gap: 8px !important;
        font-size: 0.9rem !important;
    }
    
    .reset-text {
        display: inline-block !important; /* Показываем текст на мобильном */
        font-weight: 500;
    }
    
    .reset-icon {
        font-size: 1.1rem;
    }
    
    /* Убираем тултип на мобильном */
    .reset-btn::after {
        display: none !important;
    }
    
    .reset-btn:hover {
        transform: scale(1.02) !important; /* Меньше увеличение на мобильном */
    }
    
    /* ===== MOBILE ADAPTATION FOR RESEARCH PAGE ===== */
    .back-navigation {
        margin-bottom: 20px;
    }
    
    .back-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .research-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .research-title {
        font-size: 1.8em;
        line-height: 1.2;
    }
    
    .research-title-en {
        font-size: 1.1em;
        margin-bottom: 20px;
    }
    
    .meta-info-row {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .key-result-section,
    .categories-section,
    .roles-section,
    .research-content,
    .pdf-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .key-result-section h2,
    .categories-section h2,
    .roles-section h2,
    .research-content h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .key-result-text {
        padding: 15px;
        font-size: 1em;
    }
    
    .content-wrapper h1 { font-size: 1.5em; }
    .content-wrapper h2 { font-size: 1.3em; }
    .content-wrapper h3 { font-size: 1.1em; }
    
    .pdf-link-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 92%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 15px 20px 0 20px;
    }
    
    .modal-body {
        padding: 15px 20px 20px 20px;
    }
    
    .auth-popup-content {
        width: 92%;
        max-height: 90vh;
    }
    
    .auth-popup-header {
        padding: 20px 20px 0 20px;
        padding-bottom: 15px;
    }
    
    .auth-popup-body {
        padding: 20px;
    }
}

/* ===== НОВЫЕ СТИЛИ V2.0: UX УЛУЧШЕНИЯ ===== */

/* === 1. ЛОГОТИП В ХЕДЕРЕ === */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-brand-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-brand-text .nav-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* === 2. БЛОК ВОЗМОЖНОСТЕЙ И ПРИМЕНЕНИЯ === */
.capabilities-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-purple);
    width: 100%;
    display: block;
}

.capabilities-section h2 {
    color: var(--primary-dark);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
}

.capabilities-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Подсекции внутри блока возможностей */
.capability-subsection {
    padding: 10px 0 0 0;
}

.capability-subsection:last-child {
    padding-bottom: 0;
}

.capability-subheader {
    color: var(--primary-dark);
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Горизонтальные теги для способностей и паттернов */
.capability-tags-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.capability-tag {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.capability-tag.main {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #5a67d8 100%);
    color: white;
    border-color: var(--accent-purple);
}

.capability-tag.pattern-main {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #e67e22 100%);
    color: white;
    border-color: var(--accent-orange);
}

.capability-pct {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 600;
}

.capability-tag.main .capability-pct,
.capability-tag.pattern-main .capability-pct {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Роли с переносом строк */
.capability-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-tag-clickable {
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5e8 100%);
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--accent-green);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.role-tag-clickable:hover {
    background: linear-gradient(135deg, var(--accent-green) 0%, #27ae60 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

/* === 3. УЛУЧШЕННЫЙ PDF FOOTER === */
.research-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.research-titles h3 {
    color: var(--primary-dark);
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 8px;
}

.title-en {
    color: var(--text-gray);
    font-size: 1em;
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}

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

.pdf-link-minimal,
.arxiv-link-minimal {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 400;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdf-link-minimal:hover,
.arxiv-link-minimal:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
}

.proof-label {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
    margin-left: 8px;
}

/* === 4. УЛУЧШЕННЫЕ MARKDOWN БЛОКИ === */
.markdown-block,
.example-block {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    color: #e2e8f0;
    border: 1px solid #2d3748;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.markdown-block pre,
.example-block pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 18px;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.markdown-block code,
.example-block code {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 18px;
    color: #81e6d9;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 10;
}

.copy-code-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* === 5. УЛУЧШЕННЫЙ TELEGRAM CTA === */
.footer-cta {
    margin-top: 15px;
    text-align: center;
}

.telegram-cta {
    background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 136, 204, 0.3);
}

.telegram-cta:hover {
    background: linear-gradient(135deg, #0077b3 0%, #1a8bc0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
    text-decoration: none;
    color: white;
}

/* === 6. RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .nav-brand {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .nav-brand-logo {
        width: 40px;
        height: 40px;
    }
    
    .nav-brand-text h1 {
        font-size: 1.5rem;
    }
    
    .research-footer-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .research-links {
        justify-content: center;
    }
    
    .capability-tags-horizontal {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .capability-tag {
        width: 100%;
        justify-content: space-between;
    }
}

/* АГРЕССИВНАЯ ОПТИМИЗАЦИЯ ДЛЯ УЗКИХ ЭКРАНОВ (iPhone 14 Pro Max и меньше) */
@media (max-width: 480px) {
    /* Компактный логотип */
    .nav-brand {
        gap: 4px;
    }
    
    .nav-brand-logo {
        width: 30px;
        height: 30px;
    }
    
    .nav-brand-text h1 {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
    
    .nav-brand-text .nav-subtitle,
    .nav-brand .nav-subtitle {
        font-size: 0.75rem;
    }
    
    /* Компактные кнопки навигации */
    .nav-stats {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-stat-item {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .nav-stat-number {
        font-size: 1.2rem;
    }
    
    .nav-stat-label {
        font-size: 0.75rem;
    }
    
    /* Компактные кнопки (Генерации, Избранное) */
    .generations-btn,
    .favorites-btn,
    .login-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        border-radius: 6px;
    }
    
    /* Компактный header navigation */
    .navigation {
        gap: 8px;
    }
    
    .header {
        padding: 12px 10px;
    }
    
    /* СКРЫТЬ счётчик "2558 Исследований" на мобильных */
    .nav-stat-item:has(#nav-total-research) {
        display: none;
    }
    
    /* Альтернативный селектор (если :has не поддерживается) */
    #nav-total-research {
        display: none;
    }
    
    /* Счётчик результатов на всю ширину */
    .filter-results-count.header-count {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-bottom: var(--spacing-sm);
        display: block;
    }
    
    .header-left {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        margin-bottom: 12px;
    }
    
    .header-left h1 {
        text-align: center;
        font-size: 1.3rem;
    }
    
    /* 🎯 CONTROL-GROUP ОПТИМИЗАЦИЯ для мобильного */
    /* Скрываем labels */
    .control-label {
        display: none !important;
    }
    
    /* Control-group без labels - компактно */
    .control-group {
        width: 100%;
        gap: 0;
    }
    
    /* FREE/PRO чекбоксы в одну строку 50/50 */
    .access-checkboxes-header {
        flex-direction: row !important;
        gap: 6px !important;
        width: 100%;
    }
    
    .access-checkbox-header {
        flex: 1 1 50% !important; /* 50% ширины каждый */
        width: auto !important;
        padding: 8px 6px !important;
        font-size: 0.8rem !important;
    }
    
    .checkbox-label-header {
        font-size: 0.8rem !important;
    }
    
    .access-item-count-header {
        font-size: 0.75rem !important;
    }
    
    /* Селекты сортировки на всю ширину */
    .control-select {
        width: 100%;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    /* Контейнер для сортировки и порядка - две колонки 50/50 */
    .header-controls {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    /* 🎯 УДАЛЕНО: width правила, grid сам управляет шириной */
    
    /* Контейнер для сортировки и порядка в одну строку */
    @supports (display: grid) {
        .header-controls {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: auto auto;
            gap: 8px;
        }
        
        /* Первый control-group (FREE/PRO) - на всю ширину */
        .header-controls > .control-group:first-child {
            grid-column: 1 / -1;
        }
        
        /* Второй и третий - на одной строке 50/50 */
        .header-controls > .control-group:nth-child(2) {
            grid-column: 1 / 2;
            grid-row: 2;
        }
        
        .header-controls > .control-group:nth-child(3) {
            grid-column: 2 / 3;
            grid-row: 2;
        }
    }
    
    /* Компактные карточки исследований на мобильных */
    .research-card {
        padding: 12px;
        border-radius: 8px;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* 🎯 RATING FILTER MOBILE АДАПТАЦИЯ - РАСКРЫВАЮЩИЙСЯ */
    .rating-filter-group {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important; /* Фиксированный размер, не растягиваем */
    }
    
    .rating-selection-display {
        padding: 8px 12px;
    }
    
    .rating-selection-text {
        font-size: 0.85rem;
    }
    
    .rating-reset-btn-inline {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    
    .rating-dropdown {
        padding: 12px;
    }
    
    .rating-inputs {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .rating-input-group label {
        font-size: 0.7rem;
    }
    
    .rating-input {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    .rating-separator {
        font-size: 1rem;
        margin-top: 12px;
    }
    
    .rating-slider-container {
        height: 35px;
        margin-bottom: 8px;
    }
    
    .rating-slider::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }
    
    .rating-slider::-moz-range-thumb {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .capabilities-section {
        padding: 20px;
    }
    
    .capability-subsection {
        padding: 8px 0 0 0;
    }
    
    .telegram-cta {
        padding: 10px 20px;
        font-size: 1em;
    }
}

/* === AUTH POPUP STYLES === */
.nova-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.auth-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.auth-popup-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    animation: slideInScale 0.3s ease-out;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-popup-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-popup-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.auth-close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
}

.auth-close-btn:hover {
    color: #2c3e50;
}

.auth-popup-body {
    padding: 20px;
}

.auth-popup-body p {
    margin: 0 0 20px;
    color: #64748b;
    line-height: 1.5;
}

.telegram-auth-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.telegram-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* === СОВРЕМЕННАЯ SKELETON LOADING СИСТЕМА === */

/* Skeleton контейнер - точная копия research-grid */
.skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: var(--spacing-lg);
    margin: 0;
    margin-top: 0px; /* Тот же отступ что у research-grid */
}

/* Skeleton карточка - точная копия research-card */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px; /* Минимальная высота как у настоящих карточек */
}

/* Базовый элемент скелетона */
.skeleton-element {
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite ease-in-out;
    border-radius: 6px;
}

/* Имитация .card-title - ОБНОВЛЕНО под новый размер 1.4rem */
.skeleton-title {
    height: 28px;
    width: 85%;
    margin-bottom: 24px;
}

.skeleton-title-line2 {
    height: 28px;
    width: 65%;
    margin-bottom: 24px;
}

/* Имитация .key-result-preview - ОБНОВЛЕНО под новый стиль без фона */
.skeleton-key-result {
    margin-bottom: var(--spacing-sm);
    height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-left: 0;
}

.skeleton-key-result-line {
    height: 18px;
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite ease-in-out;
    border-radius: 6px;
}

.skeleton-key-result-line.line1 { width: 100%; }
.skeleton-key-result-line.line2 { width: 85%; }
.skeleton-key-result-line.line3 { width: 60%; }

/* Имитация .card-categories */
.skeleton-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.skeleton-tag {
    height: 28px;
    width: 90px;
    border-radius: 12px;
}

.skeleton-tag.capability { width: 110px; }
.skeleton-tag.domain { width: 95px; }

/* Имитация .card-footer */
.skeleton-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid #f1f3f4;
}

.skeleton-date {
    height: 16px;
    width: 85px;
}

.skeleton-rating {
    height: 26px;
    width: 45px;
    border-radius: 6px;
}

/* Skeleton анимация */
@keyframes skeleton-wave {
    0% { 
        background-position: -200% 0; 
    }
    100% { 
        background-position: 200% 0; 
    }
}

/* Загрузочный спиннер */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Старые стили для совместимости */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite;
    border-radius: 4px;
}

/* Skeleton для фильтров */
.filter-skeleton {
    height: 40px;
    width: 180px;
    margin-bottom: var(--spacing-sm);
}

/* Skeleton показ/скрытие */
.skeleton-show {
    display: block;
}

.skeleton-hide {
    display: none;
}

/* ===== PRO USER STYLES ===== */
/* Основные стили для пользовательского статуса */
.user-status {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* PRO статус с коронкой */
.user-status.pro {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #000;
    padding-left: 20px; /* Дополнительное место для коронки */
}

/* Коронка через псевдоэлемент */
.user-status.pro::before {
    content: "👑";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-style: normal;
    line-height: 1;
}

/* FREE статус */
.user-status.free {
    background: linear-gradient(135deg, #90ee90 0%, #32cd32 100%);
    color: #000;
}

/* Стили для меню пользователя */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.username {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* ========================================
   🆕 SEARCH IN HEADER-LEFT STYLES
   ======================================== */

/* Поиск прижат справа в header-left */
.search-container-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto; /* Прижимает к правому краю */
    margin-right: 0;
}

.search-input-header {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
    background: #fff;
    transition: all 0.2s;
}

.search-input-header:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.clear-btn-header {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.clear-btn-header:hover {
    background: #ff5722;
    color: white;
    border-color: #ff5722;
}

.clear-btn-header:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e0e0e0;
}



/* Адаптивность поиска в header */
@media (max-width: 1200px) {
    .search-input-header {
        width: 250px;
        font-size: 13px;
    }
    
    .search-container-header {
        margin-left: 15px;
        margin-right: 10px;
    }
}

@media (max-width: 768px) {
    .search-container-header {
        display: none; /* На мобильных используется кнопка "📱 Фильтры" */
    }
}

/* ========================================
   🆕 ACCESS TYPE FILTER STYLES (HEADER)
   ======================================== */

/* Фильтр доступа в header */
.access-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.access-filter-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    display: none;
}

.access-checkboxes-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.access-checkbox-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    font-size: 13px;
}

.access-checkbox-header:hover {
    border-color: #2196f3;
    background: #f8f9ff;
}

.access-checkbox-header input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

.checkbox-label-header {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.access-item-count-header {
    background: #f5f5f5;
    color: #666;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    min-width: 14px;
    text-align: center;
    margin-left: 2px;
}

/* Состояние checked для header */
.access-checkbox-header input[type="checkbox"]:checked + .checkbox-label-header {
    color: #2196f3;
    font-weight: 600;
}

.access-checkbox-header:has(input:checked) {
    border-color: #2196f3;
    background: #f8f9ff;
}

.access-checkbox-header:has(input:checked) .access-item-count-header {
    background: #2196f3;
    color: white;
}

/* Адаптивность для header */
@media (max-width: 1200px) {
    .access-checkboxes-header {
        gap: 8px;
    }
    
    .access-checkbox-header {
        padding: 3px 6px;
    }
    
    .checkbox-label-header {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .access-checkboxes-header {
        flex-direction: column;
        gap: 4px;
    }
    
    .access-checkbox-header {
        padding: 6px 8px;
        width: 100%;
        justify-content: space-between;
    }
    
    .checkbox-label-header {
        font-size: 13px;
    }
}

/* ================================================================
   FAVORITES SYSTEM - Minimal Button Styles v2.0
   ================================================================ */

.back-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.favorites-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #ffd700;
    border-radius: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
}

.favorites-btn:hover {
    background: linear-gradient(135deg, #fffbf0 0%, #fff4d6 100%);
    border-color: #ffcc00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.favorites-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ВСЕХ СТРУКТУР CODE БЛОКОВ === */

/* Стили для обычных pre > code блоков */
pre > code {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #4a5568 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    overflow-x: auto !important;
    margin: 15px 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    display: block !important;
}

/* Стили для code с классами языков */
pre > code[class*="language-"] {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #4a5568 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    overflow-x: auto !important;
    margin: 15px 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    display: block !important;
}

/* Стили для всех pre блоков в целом */
pre {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #4a5568 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    overflow-x: auto !important;
    margin: 15px 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

/* Стили для inline code */
code {
    background: rgba(100, 100, 100, 0.15) !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2563eb !important;
}

/* Переопределение для всех возможных контейнеров */
.text-article pre,
.text-article pre > code,
.text-article code,
.content pre,
.content pre > code,
.content code,
article pre,
article pre > code,
article code,
div pre,
div pre > code,
div code {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #4a5568 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    overflow-x: auto !important;
    margin: 15px 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

/* Inline code в любых контейнерах */
.text-article code:not(pre code),
.content code:not(pre code),
article code:not(pre code),
div code:not(pre code) {
    background: rgba(100, 100, 100, 0.15) !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2563eb !important;
}


/* === СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ .text-article pre === */
.text-article pre {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border: 1px solid #2d3748 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    overflow-x: auto !important;
    margin: 15px 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

.text-article pre > code {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    display: block !important;
}

.text-article pre > code[class*="language-"] {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 18px !important;
    line-height: 1.5 !important;
    color: #e2e8f0 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    display: block !important;
}



/* =====================================================
   EXTRAS FAB BUTTONS - STRIPE STYLE (Professional)
   ===================================================== */

.extras-fab-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.extras-fab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    background: white;
    color: #1a1a1a;
}

.extras-fab-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d0d5dd;
    transform: translateY(-1px);
}

.extras-fab-btn.digest {
    background: white;
    color: #5469d4;
    border-color: #5469d4;
}

.extras-fab-btn.digest:hover {
    background: #f7f8fc;
}

.extras-fab-btn.concepts {
    background: white;
    color: #0ea371;
    border-color: #0ea371;
}

.extras-fab-btn.concepts:hover {
    background: #f6fdf9;
}

.extras-fab-btn.simple {
    background: white;
    color: #1a1a1a;
    border-color: #e3e8ee;
}

.extras-fab-btn.simple:hover {
    background: #fafafa;
    border-color: #d0d5dd;
}

.extras-fab-btn.locked {
    background: #fafafa;
    color: #8792a2;
    border-color: #e3e8ee;
    cursor: default;
}

.extras-fab-btn.locked:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.extras-fab-btn .icon {
    font-size: 16px;
}

.extras-fab-btn .pro-badge {
    background: #f7f8fc;
    color: #5469d4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
    border: 1px solid #e3e8ee;
}

/* =====================================================
   EXTRAS MODAL - STRIPE STYLE
   ===================================================== */

.extras-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    backdrop-filter: blur(2px);
}

.extras-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.extras-modal {
    background: white;
    border-radius: 12px;
    max-width: 1100px;
    width: 92%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.extras-modal-overlay.active .extras-modal {
    transform: scale(1) translateY(0);
}

.extras-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e3e8ee;
    background: white;
    color: #1a1a1a;
}

.extras-modal-header.digest {
    border-bottom-color: #5469d4;
}

.extras-modal-header.concepts {
    border-bottom-color: #0ea371;
}

.extras-modal-header.simple {
    border-bottom-color: #e3e8ee;
}

.extras-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1a1a1a;
}

.extras-modal-close {
    background: #f7f8fc;
    border: 1px solid #e3e8ee;
    color: #8792a2;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.extras-modal-close:hover {
    background: #e3e8ee;
    color: #1a1a1a;
}

.extras-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: #fafbfc;
}

.extras-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #8792a2;
    font-size: 16px;
}

/* =====================================================
   SIMPLE CONTENT - Highlights like screenshot
   ===================================================== */

.simple-content {
    font-size: 1.05rem;
    line-height: 1.4;
    color: #1a1a1a;
    background: white;
    padding: 28px;
    border-radius: 8px;
    border: 1px solid #e3e8ee;
}

.simple-content p {
    margin-bottom: 20px;
    text-align: left;
}

.simple-content p:last-child {
    margin-bottom: 0;
}

/* Жирный текст - желтая подсветка */
.simple-content strong {
    color: #5c589f;
    font-weight: 600;
    background: linear-gradient(120deg, #d2ebf52e 0%, rgb(164 215 240 / 12%) 100%);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Курсив - бирюзовая подсветка */
.simple-content em {
    color: #495854;
    font-style: normal;
    background: linear-gradient(120deg, rgb(145 244 231 / 12%) 0%, rgb(171 244 234 / 8%) 100%);
    padding: 1px 4px;
    border-radius: 3px;
}

/* Код - стиль как на скриншоте */
.simple-content code {
    background: rgba(255, 214, 102, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, Monaco, monospace;
    font-size: 0.9em;
    color: #1a1a1a;
    border: 1px solid rgba(255, 214, 102, 0.4);
}

/* =====================================================
   DIGEST STYLES - Stripe clean
   ===================================================== */

.digest-container {
    max-width: 100%;
    background: white;
    border-radius: 8px;
    border: 1px solid #e3e8ee;
    overflow: hidden;
}

.digest-header {
    background: linear-gradient(135deg, #5469d4 0%, #3d4eac 100%);
    color: white;
    padding: 24px;
    text-align: center;
}

.digest-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.digest-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.digest-subtitle a {
    color: white;
    text-decoration: none;
}

.digest-date {
    font-size: 0.85rem;
    opacity: 0.7;
}

.digest-table {
    width: 100%;
    border-collapse: collapse;
}

.digest-table tr {
    border-bottom: 1px solid #e3e8ee;
}

.digest-table td {
    padding: 14px 16px;
    vertical-align: top;
}

.digest-table .label-column {
    width: 200px;
    background: #fafbfc;
    border-right: 1px solid #e3e8ee;
    font-weight: 500;
    color: #5469d4;
    font-size: 0.9rem;
}

.digest-table .content-column {
    background: white;
    color: #1a1a1a;
    line-height: 1.6;
    font-size: 0.95rem;
}

.digest-table .title-row td {
    background: #f7f8fc;
    border-bottom: 2px solid #5469d4;
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.digest-table .highlight-yellow {
    background: rgba(255, 214, 102, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
}

.digest-table .highlight-green {
    background: rgba(45, 212, 191, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
}

.digest-table .highlight-blue {
    background: rgba(84, 105, 212, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
}

.digest-content .example-bad,
.digest-content .example-good {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0;
    padding: 14px;
    border-radius: 8px;
}

.digest-content .example-bad {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.digest-content .example-good {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.digest-content .example-label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.digest-content .example-bad .example-label {
    color: #dc2626;
}

.digest-content .example-good .example-label {
    color: #16a34a;
}

.digest-content .source-link {
    color: #5469d4;
    text-decoration: none;
    font-weight: 500;
}

.digest-content .source-link:hover {
    text-decoration: underline;
}

.digest-content .date-badge {
    display: inline-block;
    background: #f7f8fc;
    color: #5469d4;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 500;
    margin-top: 8px;
    margin-right: 8px;
    border: 1px solid #e3e8ee;
}

.digest-content .telegram-footer {
    margin-top: 20px;
    padding: 14px;
    background: #fafbfc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #697386;
    border: 1px solid #e3e8ee;
}

.digest-content .telegram-footer a {
    color: #5469d4;
    text-decoration: none;
    font-weight: 500;
}

/* =====================================================
   CONCEPTS STYLES - Stripe clean
   ===================================================== */

.concept-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e3e8ee;
}

.concept-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    margin-top: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0ea371;
}

.concept-content h2:first-child {
    margin-top: 0;
}

.concept-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px;
    background: white;
    font-size: 13px;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    overflow: hidden;
}

.concept-content thead {
    background: #fafbfc;
    border-bottom: 1px solid #e3e8ee;
}

.concept-content thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.concept-content tbody td {
    padding: 14px;
    border-bottom: 1px solid #e3e8ee;
    vertical-align: top;
    line-height: 1.6;
}

.concept-content tbody tr:last-child td {
    border-bottom: none;
}

.concept-content tbody tr:hover {
    background: #fafbfc;
}

.concept-content code {
    background: rgba(0, 0, 0, 0.04) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: normal !important;
    color: #374151 !important;
    border: none !important;
}

.concept-content .solution {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e3e8ee;
    color: #0ea371;
}

.concept-content .solution b {
    color: #0ea371;
}

/* =====================================================
   MOBILE ADAPTIVE
   ===================================================== */

@media (max-width: 768px) {
    .extras-fab-container {
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: stretch;
        gap: 0;
        padding: 12px;
        background: linear-gradient(to top, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.95) 100%);
        border-top: 1px solid #e3e8ee;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
        border-radius: 0;
    }

    .extras-fab-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 11px;
        border-radius: 6px;
        justify-content: center;
        margin: 0 4px;
        box-shadow: none;
        border: 1px solid #e3e8ee;
    }

    .extras-fab-btn:first-child {
        margin-left: 0;
    }

    .extras-fab-btn:last-child {
        margin-right: 0;
    }

    .extras-fab-btn .label {
        display: block;
        font-size: 10px;
    }

    .extras-fab-btn .icon {
        font-size: 14px;
    }

    .extras-fab-btn .pro-badge {
        display: none;
    }

    .extras-modal {
        width: 98%;
        max-height: 92vh;
        border-radius: 10px;
    }

    .extras-modal-header {
        padding: 16px;
    }

    .extras-modal-title {
        font-size: 16px;
    }

    .extras-modal-body {
        padding: 16px;
    }

    .simple-content {
        padding: 20px;
        font-size: 1rem;
    }

    .digest-header {
        padding: 20px;
    }

    .digest-header h1 {
        font-size: 1.3rem;
    }

    .digest-table .label-column {
        width: 130px;
        font-size: 0.8rem;
    }

    .digest-table .content-column {
        font-size: 0.9rem;
    }

    .concept-content {
        padding: 16px;
    }

    .concept-content table {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .extras-fab-container {
        padding: 10px 8px;
    }

    .extras-fab-btn {
        padding: 8px 4px;
        font-size: 10px;
        margin: 0 2px;
    }

    .extras-fab-btn .label {
        font-size: 9px;
    }

    .extras-fab-btn .icon {
        font-size: 12px;
    }

    .digest-table {
        display: block;
    }

    .digest-table tr {
        display: block;
        margin-bottom: 12px;
    }

    .digest-table td {
        display: block;
        width: 100% !important;
    }

    .digest-table .label-column {
        border-right: none;
        border-bottom: 2px solid #5469d4;
        padding: 10px;
    }
}

/* =====================================================
   EXTRAS ARTICLE HEADER (Title + Rating in modals)
   ===================================================== */

.extras-article-header {
    background: #fafbfc;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.extras-article-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    flex: 1;
}

.extras-article-rating {
    font-size: 13px;
    color: #697386;
    white-space: nowrap;
}

.extras-article-rating .rating-value {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    margin-left: 6px;
}

@media (max-width: 768px) {
    .extras-article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }
    
    .extras-article-title {
        font-size: 14px;
    }
}

/* Simple footer with TG link */
.simple-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e3e8ee;
    text-align: center;
}

.simple-footer a {
    color: #5c589f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.simple-footer a:hover {
    color: #4a4680;
    text-decoration: underline;
}

/* PDF Download Button in Modal */
.extras-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.extras-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f7f8fc;
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    color: #5469d4;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.extras-pdf-btn:hover {
    background: #5469d4;
    color: white;
    border-color: #5469d4;
}

/* Coming soon button state */
.extras-fab-btn.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0 !important;
    border-color: #d0d0d0 !important;
}

.extras-fab-btn.coming-soon:hover {
    background: #f0f0f0 !important;
    transform: none !important;
}

.extras-fab-btn.coming-soon .icon {
    opacity: 0.6;
}

.extras-fab-btn.coming-soon .label {
    color: #999 !important;
    font-size: 10px;
}

/* Code blocks with copy functionality */
.code-block {
    background: #1e1e2e;
    border-radius: 8px;
    margin: 1.5em 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.code-header {
    background: #2d2d3a;
    padding: 0.5em 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-lang {
    color: #a0a0b0;
    font-size: 0.85em;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.code-block pre {
    margin: 0;
    padding: 1em;
    overflow-x: auto;
}

.code-block code {
    color: #e0e0e0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.code-block .copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.4em 1em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.code-block .copy-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.code-block .copy-btn.copied {
    background: #48bb78;
}

/* Simple content styles */
.simple-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.simple-content h1 {
    color: #2c3e50;
    border-bottom: 3px solid #667eea;
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.simple-content h2 {
    color: #34495e;
    margin-top: 35px;
    margin-bottom: 15px;
    font-size: 1.4em;
    border-left: 4px solid #764ba2;
    padding-left: 15px;
}

.simple-content h3 {
    color: #555;
    margin-top: 25px;
    font-size: 1.2em;
}

.simple-content p {
    color: #444;
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8;
}

.simple-content ul,
.simple-content ol {
    color: #444;
    padding-left: 25px;
    margin-bottom: 20px;
}

.simple-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.simple-content code {
    background: #f4f4f4;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

.simple-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.simple-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.simple-content blockquote {
    border-left: 4px solid #667eea;
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.simple-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.simple-content th,
.simple-content td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.simple-content th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.simple-content tr:hover {
    background: #f5f5f5;
}

/* ================================================================
   DIGEST CARD STYLES - Isolated Component
   Added: 08.01.2026
   Used in: research_v2.digest_html (insertable content)
   ================================================================ */

.digest-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.digest-card .digest-section {
    margin-bottom: 20px;
}

.digest-card .digest-section:last-child {
    margin-bottom: 0;
}

.digest-card .digest-section h3 {
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.digest-card .digest-section .content {
    font-size: 1em;
    line-height: 1.6;
    color: #333;
}

.digest-card .highlight-yellow {
    background: linear-gradient(180deg, transparent 60%, #fef08a 60%);
    padding: 0 2px;
}

.digest-card .highlight-blue {
    background: linear-gradient(180deg, transparent 60%, #bfdbfe 60%);
    padding: 0 2px;
}

.digest-card .highlight-green {
    background: linear-gradient(180deg, transparent 60%, #bbf7d0 60%);
    padding: 0 2px;
}

.digest-card .examples {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
}

.digest-card .examples .bad {
    color: #dc2626;
    margin-bottom: 12px;
}

.digest-card .examples .good {
    color: #16a34a;
}

.digest-card .source {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.digest-card .meta {
    font-size: 0.75em;
    color: #aaa;
    margin-top: 16px;
}

/* ========================================
   SIMPLE CARD STYLES (Простыми словами)
   Isolated selector for research extras
   Added: 2026-01-08
   ======================================== */

.simple-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #1f2937;
}

.simple-card .original-title {
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    font-style: italic;
}

.simple-card p {
    margin: 0 0 16px 0;
    font-size: 1.05em;
}

.simple-card p:last-of-type {
    margin-bottom: 20px;
}

.simple-card strong {
    color: #111827;
    font-weight: 600;
}

.simple-card em {
    color: #4b5563;
    font-style: italic;
}

.simple-card .meta {
    font-size: 0.8em;
    color: #9ca3af;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
}

/* ========================================
   CONCEPTS CARD STYLES (Концепты)
   Isolated selector for research extras
   Added: 2026-01-08
   ======================================== */

.concepts-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.concepts-card .stats {
    display: flex;
    gap: 16px;
    margin: 24px 0;
}

.concepts-card .stat-badge {
    background: #f1f5f9;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
}

.concepts-card .stat-badge.problems { border-left: 4px solid #fcd34d; }
.concepts-card .stat-badge.methods { border-left: 4px solid #93c5fd; }
.concepts-card .stat-badge.theses { border-left: 4px solid #6ee7b7; }

.concepts-card .stat-number {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.concepts-card .stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
}

.concepts-card .meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.concepts-card .meta-item { font-size: 13px; }
.concepts-card .meta-label { color: #64748b; margin-bottom: 4px; }
.concepts-card .meta-value { font-weight: 600; color: #0f172a; }

.concepts-card .section { margin: 32px 0; }

.concepts-card .section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.concepts-card .section-icon { font-size: 24px; }

.concepts-card .section-title {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    flex: 1;
}

.concepts-card .section-count {
    background: #e2e8f0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.concepts-card table {
    width: 100%;
    border-collapse: collapse;
}

.concepts-card th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 2px solid #e2e8f0;
}

.concepts-card td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.concepts-card tr:hover td { background: #f8fafc; }
.concepts-card .concept-name { font-weight: 600; color: #0f172a; }

.concepts-card .keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.concepts-card .keyword {
    background: #e0e7ff;
    color: #4338ca;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.concepts-card .empty-section {
    padding: 20px;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}
