/* Стили для заголовков h1-h6 */
h1, h2, h3, h4, h5, h6 {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

h1 {
    font-size: 1.7rem;
    margin-top: 0.2em;
	margin-bottom: 0.6em;
}

h2 {
    font-size: 1.75rem;
    margin-top: 0.2em;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

h3 {
    font-size: 1.5rem;
    margin-top: 0.2em;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
    margin-top: 0.2em;
    font-weight: 500;
}

h6 {
    font-size: 1rem;
    margin-top: 0.2em;
    font-weight: 500;
    color: #666;
}

h1 + form,
h2 + form,
h3 + form,
h4 + form,
h5 + form,
h6 + form {
  margin-top: 1.2em;
}

blockquote > p:last-of-type {
    margin-bottom: 0;
}

.logo {
  width: 73px;
  height: 19px;
  background-image: url("/img/logo.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

body.theme-dark .logo {
    background-image: url("/img/logo-white.svg");
}

/* Для тёмной темы – корректируем разделители и цвет */
body.theme-dark h2 {
    border-bottom-color: rgba(255,255,255,0.1);
}
body.theme-dark h6 {
    color: #aaa;
}

/* Внутри поста (лонгрида) – чуть больше воздуха */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-bottom: 0.4em;
}
.post-content h1:first-child,
.post-content h2:first-child,
.post-content h3:first-child {
    margin-top: 0;
}

.icon {
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
}
.action-btn .icon, .rating button .icon, a .icon {
    pointer-events: none;
}
.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}
.post-actions button, 
.post-actions .comment-count {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    border-radius: 20px;
    transition: background 0.2s;
}
.post-actions button:hover,
.post-actions .comment-count:hover {
    background: rgba(0,0,0,0.05);
}
.post-actions .icon {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
}
/* Активное состояние закладки */
.post-actions .bookmark-btn.active .icon {
	color: #ff0000;
}
/* Голосование */
.post-actions .vote-up.active .icon {
    color: #01af14; /* зелёный */
}
.post-actions .vote-down.active .icon {
    color: #e74c3c; /* красный */
}
/* Для комментариев */
.comment-actions .vote-up.active .icon {
    color: #01af14;
}
.comment-actions .vote-down.active .icon {
    color: #e74c3c;
}
body {
    padding-bottom: 40px;
}
/* Для тёмной темы */
body.theme-dark .post-actions .icon {
    color: #c5c5c5;
}

body.theme-dark .post-actions button:hover,
body.theme-dark .post-actions .comment-count:hover {
    background: rgba(255,255,255,0.1);
}
.rating-value {
    min-width: 0.7rem;
    text-align: center;
    font-size: 0.8rem;
}
.post-content img {
    vertical-align: bottom;
}
		* { margin:0; padding:0; box-sizing:border-box; }
		body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
.container {
    max-width: 1440px;  /* шире, чтобы поместились колонки */
    margin: 0 auto;
    padding: 0 15px;
}
.row {
    display: flex;
    gap: 30px;          /* увеличенный отступ между колонками */
	justify-content: space-between;
}

.left {
    width: 280px;
    flex-shrink: 0;
	margin-top: 19px;
}

.right {
    width: 280px;
    flex-shrink: 0;
}

.center, .right {
 margin-top: 15px;
}

.center {
    flex: 1;
    min-width: 0;       /* важно для переполнения */
    max-width: 650px;   /* оптимальная ширина для чтения */
}
		@media (max-width: 768px) { .left, .right { display: none; } .center { width:100%; } }
		header { border-bottom:1px solid #eaeaea; padding:7px 0; margin-bottom:0px; }
		.logo { font-size:1.5rem; font-weight:bold; outline: none; }
		.left nav ul { list-style: none; }
		.left nav li { margin-bottom:0px; margin-right: 40px; }
		.left nav a,
		.rlink a
		{ text-decoration: none; color:#1da1f2; }
		.search-form { margin-bottom:20px; }
		.search-form input { width:100%; padding:8px 12px; border:1px solid #ccc; border-radius:20px; }
		.post { 
		border-bottom:1px solid #eaeaea; 
		padding-bottom: 10px;
		margin-bottom: 15px;		
		}
		.post-header { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
		img.avatar { border-radius:50%; object-fit:cover; }
		.avatar-placeholder {
			display: inline-flex;
			align-items: center;
			justify-content: center;
			border-radius: 50%;
			font-weight: bold;
			text-transform: uppercase;
			flex-shrink: 0;
			user-select: none;
			pointer-events: none;
			-webkit-font-smoothing: antialiased;
			-moz-osx-font-smoothing: grayscale;
		}
		.author-name, .comment-author { font-weight:bold; font-size:0.9rem; text-decoration:none; color:inherit; }
		.post-time, .comment-time { color:#666; font-size:0.8rem; }
		.post-updated { color:green; font-size:0.8rem; }
		.post-title { font-size:1.2rem; margin-bottom:8px; }
		.post-title a { text-decoration:none; color:inherit; }
		.post-preview { margin-bottom:10px; }
		.action-btn { background:none; border:none; cursor:pointer; font-size:1rem; }
		.rating { display:flex; align-items:center; gap:5px; margin-left:auto; }
		.loader { text-align:center; padding:20px; display:none; }
		.loader img {
			display: inline-block;
		}
		.notification-item.unread {
			background: #f0f8ff;
			font-weight: 500;
		}		
		/* Тёмная тема */
		body.theme-light { background:#fff; color:#000; }
		body.theme-dark { background:#1a1a1a; color:#c5c5c5; }
		body.theme-dark .post { border-bottom-color:#333; }
		body.theme-dark .post-time { color:#aaa; }
		body.theme-dark .search-form input { background:#2d2d2d; border-color:#444; color:#fff; }
		body.theme-dark .left nav a,
		body.theme-dark .rlink a
		{ color:#6ab0f5; }

		body.theme-dark #notifications-dropdown {
			color: #c5c5c5;
		}
		body.theme-dark .notification-item {
			border-bottom-color: #444;
		}
		body.theme-dark .notification-item.unread {
			background: #3a3a3a;
			font-weight: 500;
		}
		.avatar-placeholder {
			display: inline-flex;
			align-items: center;
			justify-content: center;
			border-radius: 50%;
			font-weight: bold;
			text-transform: uppercase;
			flex-shrink: 0;
		}		
		
		/* Для тёмной темы (уже добавлено в main.php, но продублируем) */
		body.theme-dark .tags-autocomplete {
			background: #2d2d2d;
			border-color: #444;
			color: #c5c5c5;
		}
		body.theme-dark .tags-autocomplete div:hover {
			background: #3a3a3a;
		}
		/* Подсветка совпадений */
		.tags-autocomplete strong {
			color: #e67e22;
			background: #fef5e7;
			font-weight: bold;
		}
		body.theme-dark .tags-autocomplete strong {
			color: #f39c12;
			background: #3e2a1f;
		}
		
/* Стили для зоны Dropzone */
.dropzone {
    border: 2px dashed #ccc;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    transition: border 0.3s, background 0.3s;
    min-height: 150px;
}
.dropzone.drag-over {
    border-color: #1da1f2;
    background: #eef;
}
.dz-message {
    font-size: 1.1rem;
    color: #666;
}
/* Тёмная тема */
body.theme-dark .dropzone {
    background: #2d2d2d;
    border-color: #555;
}
body.theme-dark .dz-message {
    color: #aaa;
}
body.theme-dark .dropzone.drag-over {
    border-color: #6ab0f5;
    background: #3a3a3a;
}
/* Миниатюры файлов */
.dropzone .dz-preview .dz-remove {
    color: #f00;
}		

/* Галерея (сетка изображений) */
.image-grid,
.image-grid-row,
.image-grid-item,
.image-grid-item a,
.image-grid-item img {
    margin: 0;
    padding: 0;
    border: 0;
    line-height: 0;
	outline: none;
}

.image-grid {
    margin: 6px 0;
	padding-top: 6px;
}

.image-grid-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
}

.image-grid-item {
    flex: 1 1 0;
    min-width: 0;
    margin-bottom: 12px;	
}

.image-grid-item a {
    display: block;
    line-height: 0;            /* убиваем лишнюю высоту строки */
}

.image-grid-item img {
    width: 100%;
    aspect-ratio: 1 / 1;       /* квадратные превью */
    object-fit: cover;
    border-radius: 8px;
    display: block;            /* убирает дополнительный отступ снизу */
}

.image-grid-item-preview img {
    width: 100%;
    aspect-ratio: 2.5 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.image-grid-item video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Все изображения в теле поста */
.post-content img,
.post-content video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0px 0;
}

/* Чтобы ссылки с картинками не имели подчёркивания */
.post-content a:has(img) {
    text-decoration: none;
}

.post-content img, .post-content video, .post-media-gallery img, .post-media-gallery video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
	outline: none;
}

/* Накладываем иконку Play поверх видео */
.post-media-gallery .image-grid-item {
    position: relative;
}
.post-media-gallery .image-grid-item a[data-media="video"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10' /%3E%3Cpolygon points='10,8 16,12 10,16' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 64px 64px;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.post-media-gallery .image-grid-item a[data-media="video"]:hover::before {
    opacity: 1;
}

/* Двухколоночный комментарий */
.comment {
    display: flex;
    gap: 0px;
    margin-top: 10px;
    position: relative;
}

.comment-left {
    flex-shrink: 0;
    width: 40px;
    position: relative; /* для позиционирования линии */
}

.comment-right {
    flex: 1;
    min-width: 0;
}

/* Линия – абсолютно позиционируется внутри левой колонки родителя */
.thread-line-wrapper {
	position: absolute;
    left: 0;
    top: 32px;
    width: 32px;
    height: calc(100% - 51px);
    cursor: pointer;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.thread-line {
    width: 1px;
    height: 100%;
    background-color: #ddd;
    transition: background 0.2s;
}

.thread-line::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 16px;
    height: 1px;
    background-color: inherit;
    border-radius: 0 1px 1px 0;
}

.thread-line-wrapper:hover .thread-line {
    background-color: #1da1f2;
}

.thread-line-wrapper.collapsed .thread-line {
    background-color: #888;
}

.replies {
    margin-top: 8px;
}
.replies-loader {
    margin-top: 8px;
}

.replies img.avatar {
    position: absolute;
    top: 8px;
    left: 3px;
}

.replies .comment-left {
    width: 34px;
}

/* Ограничиваем максимальный отступ до 5 уровней */
.comment[data-level] {
    margin-left: calc(min(var(--level), 5) * 20px);
}


/* Блок сортировки комментариев */
.comments-sort {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.sort-btn {
    background: none;
    border: none;
    padding: 6px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1da1f2;
}

.sort-btn.active {
    background: #1da1f2;
    color: white;
}

/* Тёмная тема */
body.theme-dark .comments-sort {
    border-bottom-color: #333;
}

body.theme-dark .sort-btn {
    color: #aaa;
}

body.theme-dark .sort-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #6ab0f5;
}

body.theme-dark .sort-btn.active {
    background: #6ab0f5;
    color: #1a1a1a;
}

.inline-reply-form {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    border: 1px solid #eaeaea;
}

body.theme-dark .inline-reply-form {
    background: #2a2a2a;
    border-color: #444;
}

.inline-reply-form textarea {
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 8px;
    font-family: inherit;
}

.inline-reply-form button {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
}

.inline-reply-form button.cancel-reply {
    background: #ccc;
    color: #333;
}

.inline-reply-form button:hover {
    opacity: 0.9;
}

/* Основная форма комментария (вверху) */
#commentForm {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
}

body.theme-dark #commentForm {
    background: #2a2a2a;
    border-color: #444;
}

#commentForm textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

#commentForm button[type="submit"] {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 8px;
}

#commentForm button[type="submit"]:hover {
    background: #0c85d0;
}

body.theme-dark #commentForm textarea {
    background: #1e1e1e;
    border-color: #555;
    color: #c5c5c5;
}

/* Тосты */
#toast-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Основная форма комментария */
.main-comment-form {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #eaeaea;
}
body.theme-dark .main-comment-form {
    background: #2a2a2a;
    border-color: #444;
}
.main-comment-form textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 10px;
    font-family: inherit;
    resize: vertical;
}
.main-comment-form button[type="submit"] {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 8px;
}
.form-loader {
    margin-left: 8px;
    vertical-align: middle;
}

/* Инлайн-форма ответа */
.inline-reply-form {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}
body.theme-dark .inline-reply-form {
    background: #2a2a2a;
    border-color: #444;
}
.inline-reply-form textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 8px;
    font-family: inherit;
}
.inline-reply-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.inline-reply-actions button {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
}
.inline-reply-actions button.cancel-reply {
    background: #ccc;
    color: #333;
}
.reply-loader {
    vertical-align: middle;
}

/* Порядок действий комментария */
.comment-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
}
.comment-actions .rating {
    display: flex;
    align-items: center;
    gap: 4px;
}
.comment-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.comment-actions button:hover {
    background: rgba(0,0,0,0.05);
}
body.theme-dark .comment-actions button:hover {
    background: rgba(255,255,255,0.1);
}

.comment-actions .icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
}

/* Переопределяем для рейтинга в комментариях - убираем прижатие вправо */
.comment-actions .rating {
    margin-left: 0;
}

/* Компактная форма */
.comment-form-field textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: all 0.2s;
}

.comment-form-field textarea:focus {
    border-color: #1da1f2;
    outline: none;
}

/* Страница "Мои комментарии" – карточки */
.my-comments-page h1 {
    margin-bottom: 24px;
    font-size: 1.8rem;
}

.empty-message {
    text-align: center;
    color: #888;
    margin-top: 40px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-card {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #eaeaea;
    transition: box-shadow 0.2s;
}

body.theme-dark .comment-card {
    background: #2a2a2a;
    border-color: #444;
}

.comment-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #666;
}

body.theme-dark .comment-meta {
    color: #aaa;
}

.comment-date {
    font-weight: 500;
}

.comment-rating {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 20px;
}

body.theme-dark .comment-rating {
    background: #3a3a3a;
}

.comment-text {
    margin-top: 4px;
    line-height: 1.35;
    word-break: break-word;
    font-size: 0.91rem;
}

.comment-post {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    border-top: 1px solid #eaeaea;
    padding-top: 12px;
    margin-top: 4px;
}

body.theme-dark .comment-post {
    border-top-color: #444;
}

.comment-post a {
    color: #1da1f2;
    text-decoration: none;
}

.comment-post a:hover {
    text-decoration: underline;
}

/* Пагинация (оставляем как есть) */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination a {
    padding: 6px 12px;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    text-decoration: none;
    color: #1da1f2;
    background: #fff;
}

body.theme-dark .pagination a {
    background: #2a2a2a;
    border-color: #444;
}

.pagination a.active {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.pagination a:hover:not(.active) {
    background: #eef;
}

body.theme-dark .pagination a:hover:not(.active) {
    background: #3a3a3a;
}

.comment-edit-date {
	font-size: 0.8rem;
    color: #888;
}
body.theme-dark .comment-edit-date {
    color: #aaa;
}

/* Общие стили для форм (логин, регистрация, настройки, обратная связь) */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: #1da1f2;
    outline: none;
}
.form-group button {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
.form-group button:hover {
    background: #0c85d0;
}

/* Тёмная тема для форм */
body.theme-dark .form-group input,
body.theme-dark .form-group textarea {
    background: #1e1e1e;
    border-color: #555;
    color: #c5c5c5;
}
body.theme-dark .form-group input:focus,
body.theme-dark .form-group textarea:focus {
    border-color: #6ab0f5;
}
body.theme-dark .form-group button {
    background: #6ab0f5;
    color: #1a1a1a;
}
body.theme-dark .form-group button:hover {
    background: #4a90e2;
}

.post-header-actions {
    display: inline-flex;
    gap: 10px;
    margin-left: 12px;
}
.post-header-actions a,
.post-header-actions button {
    font-size: 0.8rem;
    background: none;
    border: none;
    color: #1da1f2;
    cursor: pointer;
    text-decoration: none;
}
.post-header-actions button:hover,
.post-header-actions a:hover {
    text-decoration: underline;
}
body.theme-dark .post-header-actions a,
body.theme-dark .post-header-actions button {
    color: #6ab0f5;
}

/* Разделитель между постом и комментариями */
.post-comments-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 14px 0 14px;
}
.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ccc, transparent);
}
.divider-icon {
    font-size: 1.2rem;
    opacity: 0.6;
    color: #666;
}
body.theme-dark .divider-line {
    background: linear-gradient(90deg, transparent, #555, transparent);
}
body.theme-dark .divider-icon {
    color: #aaa;
}

/* Запрет выделения иконок и декоративных элементов */
.icon,
.divider-icon,
.action-btn svg,
.post-header-actions svg,
.bookmark-btn svg,
.vote-up svg,
.vote-down svg,
.copy-link svg,
.comment-count svg {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none; /* иконка не перехватывает клик — кликабельной остаётся кнопка */
}

/* Дополнительно для эмодзи в разделителе */
.divider-icon {
    user-select: none;
    -webkit-user-select: none;
    display: inline-block;
}

.post-type-toggle { display: flex; gap: 10px; }
.post-type-toggle .toggle-btn {
    padding: 8px 20px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 30px;
    transition: 0.2s;
    color: #333;
}
.post-type-toggle .toggle-btn.active {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}
body.theme-dark .post-type-toggle .toggle-btn {
    background: #2d2d2d;
    border-color: #444;
    color: #c5c5c5;
}
body.theme-dark .post-type-toggle .toggle-btn.active {
    background: #6ab0f5;
    color: #1a1a1a;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 8px; }
.form-control { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-family: inherit; }
.form-actions { display: flex; gap: 15px; margin-top: 20px; }
.btn { padding: 10px 20px; border-radius: 30px; cursor: pointer; border: none; font-weight: 500; }
.btn-primary { background: #1da1f2; color: white; }
.btn-secondary { background: #6c757d; color: white; }
body.theme-dark .form-control { background: #1e1e1e; border-color: #555; color: #c5c5c5; }
.tags-autocomplete {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: var(--bg-color, #fff);
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
}
.tags-autocomplete div {
    font-size: 0.9rem;
}

.alert { padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.flash-success { background: #d4edda; color: #155724; padding: 10px; border-radius: 5px; margin-bottom: 15px; }
.flash-error { background: #f8d7da; color: #721c24; padding: 10px; border-radius: 5px; margin-bottom: 15px; }
.media-list { display: flex; flex-wrap: wrap; gap: 15px; }
.media-item { border: 1px solid #eaeaea; padding: 8px; border-radius: 8px; }
body.theme-dark .media-item { border-color: #444; }

form#postForm {
    margin-bottom: 100px;
}
.checkboxes-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}
.checkboxes-group label {
    font-weight: normal;
    cursor: pointer;
}

input.flag_no_update_edit, .checkboxes-group input {
    width: 20px;
}

.unselectable {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none;   /* Chrome, Safari, Opera */
  -khtml-user-select: none;    /* Konqueror */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge */
  user-select: none;           /* Стандартный синтаксис */
}

/* Убираем стандартную обводку, заменяем на приятную тень */
textarea:focus,
input:focus,
img:focus {
    outline: none;
}
input:focus,
textarea:focus,
.tox-edit-area__iframe:focus {
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.3);
}

/* Стили для блока тегов на странице поста */
.post-tags {
    margin: 20px 0 10px;
    padding: 8px 0;
    font-size: 0.7rem;        /* маленький шрифт */
    text-transform: uppercase; /* заглавные буквы */
    letter-spacing: 0.5px;    /* небольшой интервал */
    color: #555;
}
.post-tags a {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 12px;
    margin: 4px 6px 4px 0;
    border-radius: 20px;
    text-decoration: none;
    color: #1da1f2;
    font-size: 0.7rem;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
}
.post-tags a:hover {
    background: #c5c5c5;
    color: #0c85d0;
}
/* Тёмная тема для тегов */
body.theme-dark .post-tags {
    color: #aaa;
}
body.theme-dark .post-tags a {
    background: #2d2d2d;
    color: #6ab0f5;
}
body.theme-dark .post-tags a:hover {
    background: #3a3a3a;
    color: #4a90e2;
}

/* Общие стили для таблиц внутри постов */
.post-content table {
    background: #dadada;
    border-collapse: collapse;  /* убираем пробелы между ячейками */
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 20px auto;
    text-align: left;
    width: auto;
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.post-content th,
.post-content td {
    padding: 8px 12px;
    border: 1px solid #ddd;
}

.post-content th {
    background: #e9ecef;
    font-weight: 600;
    color: #1e1e1e;
}

.post-content td {
    background: #fff;
}

/* Адаптивность для мобильных – горизонтальная прокрутка */
@media screen and (max-width: 600px) {
    .post-content table {
        display: block;
        overflow-x: auto;
    }
}

.post-content table img {
    min-width: 80px;  /* или любое разумное значение */
    width: auto;
    height: auto;
}

/* Тёмная тема */
body.theme-dark .post-content table {
    background: #2a2a2a;
    border-color: #444;
}

body.theme-dark .post-content th {
    background: #3a3a3a;
    border-color: #444;
    color: #c5c5c5;
}

body.theme-dark .post-content td {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

/* Основные стили текста внутри поста (лонгрида) */
.post-content {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1a1a1a;
    letter-spacing: 0.01em;
}

/* Отступы между абзацами */
.post-content p {
    margin-bottom: 1em;
    margin-top: 0;
}

/* Заголовки внутри поста – чуть больше воздуха */
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    font-weight: 600;
    line-height: 1.3;
}

.post-content h1 { font-size: 1.6rem; }
.post-content h2 { font-size: 1.5rem; border-bottom: 1px solid rgba(0,0,0,0.1); }
.post-content h3 { font-size: 1.3rem; }
.post-content h4 { font-size: 1.1rem; }

/* Списки */
.post-content ul, .post-content ol {
    margin: 0.8em 0 1em 0.5em;
    padding-left: 0;
}

/* Цитаты */
.post-content blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 4px solid #1da1f2;
    background: #f5f5f5;
    font-style: italic;
    color: #555;
}

/* Тёмная тема для текста */
body.theme-dark .post-content {
    color: #c5c5c5;
}
body.theme-dark .post-content h2 {
    border-bottom-color: rgba(255,255,255,0.1);
}
body.theme-dark .post-content blockquote {
    background: #2a2a2a;
    color: #bbb;
}
body.theme-dark .post-content blockquote {
    border-left-color: #6ab0f5;
}

/* Шапка блога / профиля */
.blog-cover {
    position: relative;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.cover-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cover-placeholder {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.blog-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 0 20px 20px 20px;
    margin-top: -50px;
    position: relative;
    flex-wrap: wrap;
}

.avatar-wrapper {
    flex-shrink: 0;
}

.avatar-wrapper .avatar-placeholder,
.avatar-wrapper img.avatar {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    border: 4px solid #fff;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blog-details {
    flex: 1;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.4);
    padding: 12px 20px;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}
body.theme-dark .blog-details {
    background: rgba(0, 0, 0, 0.5);
}

.blog-details h1 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
}

.blog-about {
    color: #555;
    margin-bottom: 12px;
    line-height: 1.4;
}

.blog-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.subscribers-label {
    font-size: 0.9rem;
    color: #666;
}

.subscribe-btn {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.subscribe-btn:hover {
    background: #0c85d0;
}

/* Тёмная тема */
body.theme-dark .blog-cover {
    background: #2a2a2a;
}

body.theme-dark .avatar-wrapper .avatar-placeholder,
body.theme-dark .avatar-wrapper img.avatar {
    border-color: #1a1a1a;
    background: #1a1a1a;
}

body.theme-dark .blog-about {
    color: #aaa;
}

body.theme-dark .subscribers-label {
    color: #aaa;
}

body.theme-dark .subscribe-btn {
    background: #6ab0f5;
    color: #1a1a1a;
}

body.theme-dark .subscribe-btn:hover {
    background: #4a90e2;
}

/* Чекбоксы в настройках не должны быть на всю ширину */
.settings-form input[type="checkbox"] {
    width: auto;
    max-width: none;
    margin-right: 8px;
}
/* Если нужен более специфичный селектор */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    max-width: none;
    display: inline-block;
}

.form-divider {
    margin: 24px 0;
    border-top: 1px solid #eaeaea;
}
body.theme-dark .form-divider {
    border-top-color: #444;
}
.settings-page {
    margin-bottom: 60px;
}
.blog-extra {
    margin-bottom: 20px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.blog-extra .extra-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.blog-extra .extra-title {
    font-size: 1rem;
}

.blog-extra .extra-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    color: inherit;
}

.blog-extra .extra-toggle .icon {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.blog-extra .extra-content {
    transition: display 0.2s;
    margin-top: 12px;
	max-height: 60vh; overflow-y: auto;
	text-align: justify;
}

body.theme-dark .blog-extra {
    background: #2a2a2a;
}

.comment-number {
    position: relative;
    top: -2px;
    margin-left: 2px;	
}
.comment-count {
    line-height: 1; /* дополнительно выравниваем высоту строки */
}
/* Ограничение высоты только для одиночных видео (вне галереи) */
.post-media-gallery:not(.image-grid) video {
    max-height: 70vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Опционально: центровка контейнера одиночного видео */
.post-media-gallery:not(.image-grid) {
    display: flex;
    justify-content: center;
}
/* Поисковая форма и подсказки */
.search-wrapper {
    flex: 1;
    margin: 0 20px;
}

.search-suggestions div {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}



.search-suggestions div:hover {
    background: #f0f0f0;
}

/* Тёмная тема */
body.theme-dark .search-wrapper input {
    background: #2d2d2d;
    border-color: #555;
    color: #c5c5c5;
}

body.theme-dark .search-suggestions {
    background: #2d2d2d;
    border-color: #444;
}

body.theme-dark .search-suggestions div {
    border-bottom-color: #444;
}

body.theme-dark .search-suggestions div:hover {
    background: #3a3a3a;
}
.search-suggestions div.active-suggestion {
    background-color: #f0f0f0;
}
body.theme-dark .search-suggestions div.active-suggestion {
    background-color: #3a3a3a;
}
.search-suggestions div.active-suggestion,
.search-suggestions div.active-suggestion:hover {
    background: #f0f0f0;
}

body.theme-dark .search-suggestions div.active-suggestion,
body.theme-dark .search-suggestions div.active-suggestion:hover {
    background: #3a3a3a;
}
.search-suggestions div strong {
    font-weight: bold;
    color: #1da1f2; /* можно другой цвет */
}

.search-suggestions {display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); z-index: 1000; max-height: 90vh; overflow-y: auto;}

/* Тёмная тема */
body.theme-dark .search-suggestions div strong {
    color: #6ab0f5;
}

.search-result-item {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eaeaea;
}
.search-result-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.search-result-text {
    flex: 1;
}
.search-result-title {
    font-size: 1.25rem;
    margin-bottom: 6px;
    line-height: 1.3;
}
.search-result-title a {
    text-decoration: none;
    color: #1da1f2;
}
.search-result-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}
.search-result-snippet {
    line-height: 1.4;
    color: #333;
}
.search-result-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}
.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}
/* Тёмная тема */
body.theme-dark .search-result-item {
    border-bottom-color: #444;
}
body.theme-dark .search-result-meta {
    color: #aaa;
}
body.theme-dark .search-result-snippet {
    color: #ccc;
}
/* Адаптивность */
@media (max-width: 600px) {
    .search-result-content {
        flex-direction: column;
    }
    .search-result-image {
        width: 100%;
        height: auto;
        max-width: 200px;
        margin-top: 8px;
    }
}
.search-line {
	margin-bottom: 24px;
    padding-bottom: 16px;	
	border-bottom: 1px solid #eaeaea;
}
body.theme-dark .search-line {
	border-bottom: 1px solid #444;
}
a.spotlight { outline: none; }

/* Выпадающее меню пользователя */
.user-menu-wrapper {
    position: relative;
}
.user-avatar-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.user-dropdown {
    position: absolute;
    right: 0;
    top: 40px;
    width: 220px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}
.user-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.user-dropdown-menu li a {
    display: block;
    padding: 4px 16px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}
.user-dropdown-menu li a:hover {
    background: #f0f0f0;
}
/* Тёмная тема */
body.theme-dark .user-dropdown {
    background: #2d2d2d;
    border-color: #444;
}
body.theme-dark .user-dropdown-menu li a {
    color: #c5c5c5;
}
body.theme-dark .user-dropdown-menu li a:hover {
    background: #3a3a3a;
}
.user-dropdown-menu .user-dropdown-login {
    margin-bottom: 4px;
    border-bottom: 1px solid #eaeaea;
}
.user-dropdown-menu .user-dropdown-login a {
    display: block;
    padding: 8px 16px;
    font-weight: bold;
    color: inherit;
    text-decoration: none;
}
.user-dropdown-menu .user-dropdown-login a:hover {
    background: #f0f0f0;
}
body.theme-dark .user-dropdown-menu .user-dropdown-login {
    border-bottom-color: #444;
    color: #c5c5c5;	
}
body.theme-dark .user-dropdown-menu .user-dropdown-login a:hover {
    background: #3a3a3a;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-right .icon {
    vertical-align: middle;
}
/* Блок уведомлений */
.notifications-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.notifications-icon {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    position: relative;
}

.notifications-icon .icon {
    width: 23px;
    height: 23px;
}

.notif-badge {
    display: none;
    background: red;
    color: white;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 12px;
    position: absolute;
    top: -8px;
    right: -12px;
    line-height: 1.4;
}

#notifications-dropdown {
	display: none;
    position: absolute;
    right: 0;
    top: 35px;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    scrollbar-width: thin;
}

/* Мобильная версия (≤768px): окно растягивается на всю ширину с отступами */
@media (max-width: 768px) {
    .notifications-wrapper {
        position: static;
    }
    #notifications-dropdown {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 55px;
        width: auto;
        max-width: none;
        max-height: 60vh;
    }
    .user-menu-wrapper {
        position: static;
    }
    .user-dropdown {
        position: fixed;
        right: 10px;
        top: 55px;
        width: 220px;
        max-width: calc(100% - 20px);
        /* остальные стили наследуются от десктопа */
    }	
    .mobile-extra-nav + .center {
        margin-top: 0;
    }	
}

/* Тёмная тема */
body.theme-dark #notifications-dropdown {
    background: #2d2d2d;
    border-color: #444;
}

#notifications-dropdown::-webkit-scrollbar {
    width: 6px;
}
#notifications-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
#notifications-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.left strong {
    display: block;
    margin-bottom: 8px;
}
/* Для мобильной версии не нужно переопределять */
@media (max-width: 1280px) {
    .left strong {
        margin-bottom: 12px;
    }
}
.left nav + nav {
    margin-top: 15px;
}

body.theme-dark #notifications-dropdown::-webkit-scrollbar-track {
    background: #444;
}
body.theme-dark #notifications-dropdown::-webkit-scrollbar-thumb {
    background: #666;
}

.notifications-header {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.notifications-mark-all {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

#mark-all-read {
    background: none;
    border: none;
    color: #1da1f2;
    cursor: pointer;
}

.notifications-loader {
    text-align: center;
    padding: 10px;
    display: none;
}

body.theme-dark .notifications-header,
body.theme-dark .notifications-mark-all {
    border-bottom-color: #444;
}

body.theme-dark #mark-all-read {
    color: #6ab0f5;
}
.user-dropdown-menu .user-dropdown-login {
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
}
.user-dropdown-menu li a,
.user-dropdown-menu .user-dropdown-login {
    font-size: 0.85rem;
}
/* Кнопка переключения ответов */
.toggle-replies {
    background: none;
    border: none;
    color: #1da1f2;
    cursor: pointer;
    font-size: 0.85rem;
    padding-bottom: 12px;
}
.toggle-replies:hover {
    text-decoration: underline;
}
/* Тёмная тема */
body.theme-dark .toggle-replies {
    color: #6ab0f5;
}
/* Скрываем галерею, пока она не обработана JS */
.post-media-gallery:not([data-gallery-processed]) {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.post-media-gallery[data-gallery-processed] {
    opacity: 1;
}
.avatar-placeholder {
    line-height: 1;
}

/* ========== Планшеты и смартфоны: левая колонка в гамбургер ========== */
@media (max-width: 1280px) {
    /* Левая панель – скрыта, открывается через гамбургер */
    .left {
		margin-top: 0px;
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        background: var(--bg-color, #fff);
        z-index: 1001;
        padding: 20px;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .left.open {
        display: block;
        transform: translateX(0);
    }

    /* Гамбургер-кнопка видна на планшетах и мобильных */
    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        cursor: pointer;
        background: none;
        border: none;
    }
    .hamburger svg {
        width: 24px;
        height: 24px;
        stroke: currentColor;
        fill: none;
    }

    /* Центральная колонка – занимает всё доступное место */
    .center {
        max-width: none;
        flex: 1;
    }

    /* Правая колонка остаётся видимой, но можно её чуть уменьшить */
    .right {
        width: 280px;
        flex-shrink: 0;
    }

    /* Поисковая форма на планшетах остаётся (не прячем) */
    .search-wrapper {
        flex: 1;
        margin: 0 20px;
    }
    .search-wrapper form {
        display: block;
    }
    .search-icon-mobile {
        display: none;
    }
    .mobile-search-dropdown {
        display: none;
    }
}

/* ========== Смартфоны (<768px): правую колонку тоже прячем ========== */
@media (max-width: 768px) {
    .right {
        display: none;
    }

    /* Поиск: прячем форму, показываем иконку лупы */
    .search-wrapper {
        margin: 0;
        flex: 1;
    }
    .search-wrapper form {
        display: block;
    }
    .mobile-search-dropdown {
        display: none;
    }
    .search-icon-mobile {
        align-items: center;
        cursor: pointer;
    }
    .extra-html-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: var(--bg-secondary, #f5f5f5);
        cursor: pointer;
        font-weight: bold;
    }
    .extra-html-content {
        display: none;
        padding: 12px;
        background: var(--bg-tertiary, #fafafa);
    }
    .extra-html-content.open {
        display: block;
    }
	.canedit {
		display: none;
	}	
}

/* ========== Десктоп (>1280px): гамбургер скрыт, левая колонка статична ========== */
@media (min-width: 1281px) {
    .hamburger, .search-icon-mobile, .mobile-search-dropdown, .close-menu-btn {
        display: none;
    }
    .left {
        position: sticky;
        top: 75px;
        align-self: flex-start;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        scrollbar-width: thin;
    }
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: inherit;   /* чтобы не было прозрачности */
        border-bottom: 1px solid var(--border-color, #eaeaea);
    }
    body.theme-dark header {
        background: #1a1a1a;   /* под цвет тёмной темы */
    }	
    .center {
        max-width: 650px;
        flex: 1;
    }
	.search-wrapper {
		padding: 0px 100px;
	}	
	.search-suggestions {
		margin: 0 105px;
	}		
	.avatar-letter {
		transform: translateY(-6%);
	}
}

/* Общие стили для кнопки закрытия меню */
.close-menu-btn {
    display: none; /* по умолчанию скрыта */
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

/* Показываем кнопку закрытия только когда левая панель в мобильном режиме */
@media (max-width: 1280px) {
    .close-menu-btn {
        display: block !important;
    }
	.left nav ul {
		margin-top: 0px !important;
	}	
}

/* Десктоп: скрываем мобильные элементы */
.hamburger, .search-icon-mobile, .mobile-search-dropdown, .close-menu-btn {
    display: none;
}

/* Затемнение фона при открытом гамбургере */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}
.overlay.active {
    display: block;
}

/* Левая панель на мобильных */
@media (max-width: 768px) {
    .left {
        z-index: 1002;
        background: var(--bg-color, #fff);
    }
    .left.open {
        transform: translateX(0);
		padding-left: 20px;
    }
    /* Кнопка гамбургера */
    .hamburger {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    /* Иконка лупы */
    .search-icon-mobile {
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
    }
    /* Выпадающий поиск */
    .mobile-search-dropdown {
        display: none;
    }
    .mobile-search-dropdown.open {
        display: none;
    }
    /* Блок extra_html */
    .extra-html-dropdown {
        margin-top: 20px;
        border-top: 1px solid var(--border-color, #eaeaea);
    }
    .extra-html-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: var(--bg-secondary, #f5f5f5);
        cursor: pointer;
        font-weight: bold;
    }
    .extra-html-content {
        display: none;
        padding: 12px;
        background: var(--bg-tertiary, #fafafa);
    }
    .extra-html-content.open {
        display: block;
    }
    header {
        position: sticky;
        top: 0;
        transition: transform 0.3s ease;
        z-index: 1000;
        background: inherit;
    }
    body.theme-dark header {
        background: #1a1a1a;
    }
    header.header-hidden {
        transform: translateY(-100%);
    }	
}
img, video {
    max-width: 100%;
    height: auto;
}
.close-menu-btn {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 10;
}

/* Тёмная тема для новых элементов */
body.theme-dark .extra-html-toggle {
    background: #2a2a2a;
}
body.theme-dark .extra-html-content {
    background: #222;
}
body.theme-dark .mobile-search-dropdown {
    background: #2d2d2d;
    border-bottom-color: #444;
}
body.theme-dark .mobile-search-dropdown input {
    background: #1e1e1e;
    border-color: #555;
    color: #c5c5c5;
}
body.theme-dark .left {
    background: #1a1a1a;
}
body.theme-dark .left a {
    color: #c5c5c5;
}

/* Запрещаем перенос строк в шапке на всех устройствах */
header .container {
    flex-wrap: nowrap !important;
}

/* Логотип не должен сжиматься */
.logo {
    flex-shrink: 0;
}

/* Поисковая форма может сжиматься, но не слишком */
.search-wrapper {
    flex-shrink: 1;
}

/* Для очень узких экранов уменьшаем отступы */
@media (max-width: 420px) {
    header .container {
        gap: 10px;
    }
    .header-right {
        gap: 18px;
    }
    .search-wrapper {
        display: none !important; /* полностью скрываем контейнер поиска */
    }
    .search-icon-mobile {
        display: inline-flex !important;
        align-items: center;
        cursor: pointer;
    }
    .mobile-search-dropdown {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        background: var(--bg-color, #fff);
        padding: 12px;
        border-bottom: 1px solid #ddd;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    .mobile-search-dropdown.open {
        display: block !important;
    }
    .mobile-search-dropdown input {
        width: 100%;
        padding: 10px 16px;
        border-radius: 30px;
        border: 1px solid #ccc;
        font-size: 1rem;
    }	
    .logo {
        margin-right: auto;
    }	
}

@media (max-width: 360px) {
    .search-wrapper {
        min-width: 60px;
    }
    .header-right {
        gap: 18px;
    }
}

/* Запрещаем сжатие аватара и иконок */
.user-avatar-trigger img.avatar,
.user-avatar-trigger .avatar-placeholder {
    flex-shrink: 0 !important;
    width: 32px !important;
    height: 32px !important;
}

img.avatar {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none;   /* Chrome, Safari, Opera */
  -khtml-user-select: none;    /* Konqueror */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge */
  user-select: none;           /* Стандартный синтаксис */	
}

  
/* Убираем min-width у поисковой обёртки на узких экранах */
@media (max-width: 400px) {
    .search-wrapper {
        min-width: 0 !important;
        margin: 0 8px;
    }
    .search-wrapper input {
        min-width: 0;
        width: 100%;
    }
    /* Если всё равно не влезает – разрешаем горизонтальный скролл у header */
    header .container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    /* Но чтобы аватарка точно не съезжала, фиксируем её */
    .header-right {
        flex-shrink: 0;
    }
}

/* В крайнем случае – горизонтальный скролл для всей шапки */
@media (max-width: 340px) {
    body {
        overflow-x: auto;
    }
    .post-header a:first-child img.avatar,
    .post-header > a:first-child {
        display: none;
    }
    .post-header {
        gap: 0;
    }	
}
.search-wrapper {
    position: relative;
}
.mobile-search-dropdown {
    position: relative;
}
	
/* TomSelect в тёмной теме */
body.theme-dark .ts-wrapper {
    background: #2d2d2d;
    border-color: #555;
}
body.theme-dark .ts-control {
    background: #2d2d2d;
    color: #c5c5c5;
}
body.theme-dark .ts-dropdown {
    background: #2d2d2d;
    border-color: #444;
    color: #c5c5c5;
}
body.theme-dark .ts-dropdown .option {
    color: #c5c5c5;
}
body.theme-dark .ts-dropdown .option:hover,
body.theme-dark .ts-dropdown .active {
    background: #3a3a3a;
}
body.theme-dark .ts-control, .ts-wrapper.single.input-active .ts-control {
    background: #1e1e1e;
}
body.theme-dark .ts-control {
    border: 1px solid #555555;
}	

.notification-item {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.notification-item.unread {
    background: #f0f8ff;
}
.notification-item .notification-message {
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.notification-item .notification-date {
    font-size: 0.7rem;
    color: #666;
}
body.theme-dark .notification-item {
    border-bottom-color: #444;
}
body.theme-dark .notification-item.unread {
    background: #3a3a3a;
}
body.theme-dark .notification-item .notification-date {
    color: #aaa;
}



.search-input {width: 100%; padding: 12px 18px; border-radius: 30px; border: 1px solid #ccc;}
body.theme-dark .search-wrapper .search-input {
    background: #2d2d2d;
    border-color: #1a1a1a;
    color: #c5c5c5;
}
body.theme-dark .search-wrapper .search-input::placeholder {
    color: #aaa;
}

body.theme-dark .hamburger svg,
body.theme-dark .close-menu-btn svg {
    stroke: #c5c5c5;
	color: #c5c5c5;
}

body.theme-dark .mobile-search-dropdown .search-suggestions {
    background: #2d2d2d;
    border-color: #444;
}
body.theme-dark .mobile-search-dropdown .search-suggestions div {
    border-bottom-color: #444;
}
body.theme-dark .mobile-search-dropdown .search-suggestions div:hover {
    background: #3a3a3a;
}

/* Линия-нить в комментариях */
body.theme-dark .thread-line {
    background-color: #555;
}
body.theme-dark .thread-line-wrapper:hover .thread-line {
    background-color: #6ab0f5;
}
/* Форма ответа на комментарий */
body.theme-dark .inline-reply-form {
    background: #2a2a2a;
    border-color: #444;
}
body.theme-dark .inline-reply-form textarea {
    background: #1e1e1e;
    border-color: #555;
    color: #c5c5c5;
}
body.theme-dark .inline-reply-form button.cancel-reply {
    background: #555;
    color: #eee;
}
/* Иконки в комментариях */
body.theme-dark .comment-actions button {
    color: #c5c5c5;
}
body.theme-dark .comment-actions button:hover {
    background: rgba(255,255,255,0.1);
}

body.theme-dark .post-actions button {
    color: #c5c5c5;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

body.theme-dark header {
    border-bottom: 1px solid #2c2c2c;
}

.theme-submenu {
    list-style: none;
    padding-left: 0;
    margin-top: 0;
    display: none;
}
ul.theme-submenu li span {
    margin-left: 10px;
}
.theme-submenu.open {
    display: block !important;
}
.theme-toggle {
    cursor: pointer;
    display: block;
    user-select: none;
    padding: 4px 16px;
    transition: background 0.2s;
	color: #333;
}

.theme-toggle:hover {
    background: #f0f0f0;
}
body.theme-dark .theme-toggle {
    color: #c5c5c5;
}
body.theme-dark .theme-toggle:hover {
    background: #3a3a3a;
}

.post-header > a {
    display: flex;
	text-decoration: none;
}
.post-preview > a {
    text-decoration: none;
    color: inherit;
}
.post-single-preview {
	padding-top: 5px;
}

/* ===== Блок подписки на автора (общий стиль) ===== */
.author-subscribe-block {
    display: flex;
    gap: 15px;
    align-items: center;
    background: #f5f5f5;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* Левая часть (аватар) */
.author-subscribe-left a {
    display: block;
}
.author-subscribe-left img.avatar,
.author-subscribe-left .avatar-placeholder {
    display: block;
}

/* Правая часть (имя + кнопка) */
.author-subscribe-right {
    flex: 1;
}
.author-name-row {
    margin-bottom: 4px;
}
.author-name-row a {
    font-weight: bold;
    font-size: 0.85rem;
    text-decoration: none;
    color: inherit;
}
.author-name-row .author-slug {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}
.subscribe-author-btn {
    background: #1da1f2;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
}
.subscribe-author-btn:hover {
    background: #0c85d0;
}

/* Тёмная тема */
body.theme-dark .author-subscribe-block {
    background: #2a2a2a;
}
body.theme-dark .author-name-row .author-slug {
    color: #aaa;
}
body.theme-dark .subscribe-author-btn {
    background: #6ab0f5;
    color: #1a1a1a;
}

/* ===== Мобильная версия ===== */
.author-subscribe-block.mobile-only {
    display: none; /* по умолчанию скрыт */
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}
.author-subscribe-block.mobile-only .subscribe-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0px 8px;
    flex: 1;
}
.author-subscribe-block.mobile-only .subscribe-name,
.author-subscribe-block.mobile-only .subscribe-slug {
    white-space: nowrap;
}
.author-subscribe-block.mobile-only .subscribe-name {
    font-weight: bold;
    text-decoration: none;
    color: inherit;
}
.author-subscribe-block.mobile-only .subscribe-slug {
    font-size: 0.85rem;
    color: #666;
}
.author-subscribe-block.mobile-only .subscribe-btn {
    font-size: 0.9rem;
}
/* При очень узком экране кнопка на всю ширину */
@media (max-width: 480px) {
    .author-subscribe-block.mobile-only .subscribe-btn {
        width: 100%;
        text-align: center;
    }
}
/* Показываем мобильный блок только на экранах меньше 769px */
@media (max-width: 768px) {
    .author-subscribe-block.mobile-only {
        display: flex !important;
    }
}
.author-subscribe-block > a > img, .author-subscribe-left > a > img {
    display: block;
}


/* ===== Мобильная навигация экстра-блоков ===== */
.mobile-extra-nav {
    background: var(--bg-secondary, #f5f5f5);
    border-bottom: 1px solid var(--border-color, #eaeaea);
    padding: 6px 6px 0px 6px;
    margin: 0;
    display: none;
    position: relative;
    top: 8px;
    display: none;
}

@media (max-width: 768px) {
    .mobile-extra-nav {
        display: block;
    }
}

.mobile-extra-item {
    margin-bottom: 6px;
    border-radius: 8px;
    background: var(--bg-tertiary, #fff);
    border: 1px solid var(--border-color, #ddd);
}

.mobile-extra-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 6px 6px 12px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.mobile-extra-title {
    font-size: 0.95rem;
}

.right .extra-sticky-container {
    position: sticky;
    top: 75px;
    align-self: flex-start;
}

.mobile-extra-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    color: inherit;
}

.mobile-extra-toggle .icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.mobile-extra-content {
    border-top: 1px solid var(--border-color, #eee);
    background: var(--bg-secondary, #fafafa);
    display: none;
	text-align: justify;
	max-height: 60vh; overflow-y: auto;
}

.mobile-extra-content.open {
    display: block;
}

/* Тёмная тема */
body.theme-dark .mobile-extra-nav {
    background: #2a2a2a;
    border-bottom-color: #444;
}
body.theme-dark .mobile-extra-item {
    background: #1e1e1e;
    border-color: #444;
}
body.theme-dark .mobile-extra-content {
    background: #2a2a2a;
    border-top-color: #444;
}

.icon use[href*="triangle"] {
    fill: currentColor;
    stroke: none;
}

/* ===== Стилизация скроллбара для блоков с внутренней прокруткой ===== */
.extra-content,
.mobile-extra-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

.extra-content::-webkit-scrollbar,
.mobile-extra-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.extra-content::-webkit-scrollbar-track,
.mobile-extra-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.extra-content::-webkit-scrollbar-thumb,
.mobile-extra-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: background 0.2s;
}

.extra-content::-webkit-scrollbar-thumb:hover,
.mobile-extra-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Тёмная тема */
body.theme-dark .extra-content,
body.theme-dark .mobile-extra-content {
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

body.theme-dark .extra-content::-webkit-scrollbar-track,
body.theme-dark .mobile-extra-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .extra-content::-webkit-scrollbar-thumb,
body.theme-dark .mobile-extra-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-dark .extra-content::-webkit-scrollbar-thumb:hover,
body.theme-dark .mobile-extra-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Базовые паддинги */
.extra-content {
    padding: 0 5px 5px 5px;
}
.mobile-extra-content {
    padding: 10px 15px 15px 15px;
}

/* Если есть прокрутка – увеличиваем правый отступ */
.extra-content.has-scroll {
    padding: 0 15px 5px 5px;
}
.mobile-extra-content.has-scroll {
    padding: 10px 20px 15px 15px;
}

@media (max-width: 768px) {
    .user-dropdown-menu li a,
    .user-dropdown-menu .user-dropdown-login a {
        font-size: 1rem;       /* 16px */
        padding: 10px 16px;    /* увеличиваем область касания */
    }
    /* Опционально – увеличим размер стрелки темы */
    .theme-toggle {
        font-size: 1rem !important;
		padding: 10px 16px;
    }
}

/* Ссылки внутри контента поста — светлая тема (глобально или под body.theme-light) */
body.theme-light .post-content a,
body.theme-light .search-result-meta a
{
    color: #1a73e8;          /* спокойный, но контрастный синий */
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

body.theme-light .post-content a:visited,
body.theme-light .search-result-meta a:visited
{
    color: #6b4e9e;          /* фиолетовый оттенок для посещённых */
}

body.theme-light .post-content a:hover,
body.theme-light .search-result-meta a:hover
{
    color: #0c5ed9;          /* чуть темнее при наведении */
    text-decoration-color: rgba(26, 115, 232, 0.5);
}

body.theme-light .post-content a:active,
body.theme-light .search-result-meta a:active
{
    color: #054b9c;
}

/* Ссылки внутри контента поста — тёмная тема */
body.theme-dark .post-content a,
body.theme-dark .search-result-meta a
{
    color: #6ab0ff;          /* светлый, приятный синий */
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

body.theme-dark .post-content a:visited,
body.theme-dark .search-result-meta a:visited
{
    color: #b392f0;          /* чуть фиолетовый оттенок для посещённых */
}

body.theme-dark .post-content a:hover,
body.theme-dark .search-result-meta a:hover
{
    color: #90caf9;          /* ещё светлее при наведении */
    text-decoration-color: rgba(106, 176, 255, 0.5);
}

body.theme-dark .post-content a:active,
body.theme-dark .search-result-meta a:active
{
    color: #bbdef5;
}

@media (max-width: 768px) {
    /* Левое меню (сайдбар) – более крупные элементы */
    .left {
        padding: 20px 16px;
    }

    /* Кнопка закрытия – делаем больше */
    .left .close-menu-btn {
        top: 12px;
        right: 16px;
        padding: 8px;
        border-radius: 50%;
        background: rgba(0,0,0,0.05);
    }
    .left .close-menu-btn .icon {
        width: 32px;
        height: 32px;
    }

    /* Ссылки навигации – жирнее и крупнее */
    .left nav ul li a {
        font-size: 1.1rem;      /* ~20px */
        display: block;
        padding: 3px 0;
        border-radius: 12px;
        transition: background 0.2s;
    }
    /* При нажатии – лёгкий отклик (опционально) */
    .left nav ul li a:active {
        background: rgba(0,0,0,0.05);
    }

    /* Тёмная тема для активного состояния */
    body.theme-dark .left nav ul li a:active {
        background: rgba(255,255,255,0.1);
    }
}

/* ========== ДЕСКТОП ========== */
@media (min-width: 1280px) {
    .left nav ul li a {
        display: block;
        padding: 8px 12px 8px 22px;
        border-radius: 8px;
        transition: background 0.2s, color 0.2s;
    }
	.left nav ul li a.active {
		background: rgba(44, 44, 44, 0.1) !important;
	}
	.left nav ul li a:hover {
		background: rgba(169, 169, 169, 0.1);
	}

    body.theme-dark .left nav ul li a.active {
        background: rgba(106, 176, 245, 0.2) !important;
    }
	body.theme-dark .left nav ul li a:hover	{
        background: rgba(106, 176, 245, 0.12);
    }	
}

/* ========== МОБИЛЬНЫЕ ========== */
@media (max-width: 1280px) {	
    .left nav ul li a {
        display: inline-block;
        padding: 8px 16px;
        font-size: 1.1rem;
        border-radius: 12px;
        margin: 0;
    }
    .left nav ul li a.active,
    .left nav ul li a:hover	{
        background: rgba(109, 109, 109, 0.1);
    }
	aside.left nav ul li div.sub_cat {
		padding: 8px 16px !important;
	}	
    body.theme-dark .left nav ul li a.active {
        background: rgba(106, 176, 245, 0.2) !important;
    }
    body.theme-dark .left nav ul li a:hover	{
        background: rgba(106, 176, 245, 0.12);
    }	
	.left nav + nav {
		margin-top: 20px;
	}	
	.left-footer-meta span {
		display: block;
	}	
}

/* ===== Стилизация скроллбара в левой панели ===== */

@media (min-width: 1281px) {
    .left {
        position: sticky;
        top: 75px;
        align-self: flex-start;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        scrollbar-width: thin;
        transition: scrollbar-color 0.2s;
		scrollbar-color: transparent transparent;
    }
    /* WebKit: делаем полосу и бегунок прозрачными */
    .left::-webkit-scrollbar {
        width: 6px;
    }
    .left::-webkit-scrollbar-track {
        background: transparent;
    }
    .left::-webkit-scrollbar-thumb {
        background: transparent;
    }
    /* При наведении – показываем */
    .left:hover {
        scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
    }
    .left:hover::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
    }
    .left:hover::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
    }
    .left:hover::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.4);
    }

    /* Тёмная тема – аналогично */
    body.theme-dark .left {
        scrollbar-color: transparent transparent;
    }
    body.theme-dark .left:hover {
        scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
    }
    body.theme-dark .left:hover::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }
    body.theme-dark .left:hover::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
    }
    body.theme-dark .left:hover::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.4);
    }
}

.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

body.theme-dark input[name="scheduled_publish"] {
	color-scheme: dark;
}

aside.left nav ul li div.sub_cat {
    padding: 8px 12px 8px 22px;
}
aside.left nav ul li a span {
    padding-left: 6px;
}

padding-left: 6px;
.post-full video {
    width: fit-content;
}
.yt-placeholder {
  background:url(https://i.rutab.net/img/yt-loading.gif) center center no-repeat;
}
.load-placeholder {
  background:url(/img/bouncing-circles.svg) center center no-repeat;
}
iframe.load-placeholder,
iframe.yt-placeholder
{
    aspect-ratio: 16 / 9;
    width: 100% !important;
}

lite-youtube {
    background-color: #000;
    position: relative;
    display: block;
    contain: content;
    background-position: center center;
    background-size: cover;
    cursor: pointer;
    max-width: 650px;
	border-radius: 8px;
}

/* gradient */
lite-youtube::before {
    content: attr(data-title);
    display: block;
    position: absolute;
    top: 0;
    /* Pixel-perfect port of YT's gradient PNG, using https://github.com/bluesmoon/pngtocss plus optimizations */
    background-image: linear-gradient(180deg, rgb(0 0 0 / 67%) 0%, rgb(0 0 0 / 54%) 14%, rgb(0 0 0 / 15%) 54%, rgb(0 0 0 / 5%) 72%, rgb(0 0 0 / 0%) 94%);
    height: 99px;
    width: 100%;
    font-family: "YouTube Noto",Roboto,Arial,Helvetica,sans-serif;
    color: hsl(0deg 0% 93.33%);
    text-shadow: 0 0 2px rgba(0,0,0,.5);
    font-size: 18px;
    padding: 25px 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

lite-youtube:hover::before {
    color: white;
}

/* responsive iframe with a 16:9 aspect ratio
    thanks https://css-tricks.com/responsive-iframes/
*/
lite-youtube::after {
    content: "";
    display: block;
    padding-bottom: calc(100% / (16 / 9));
}
lite-youtube > iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
}

/* play button */
lite-youtube > .lyt-playbtn {
    display: block;
    /* Make the button element cover the whole area for a large hover/click target… */
    width: 100%;
    height: 100%;
    /* …but visually it's still the same size */
    background: no-repeat center/68px 48px;
    /* YT's actual play button svg */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>');
    position: absolute;
    cursor: pointer;
    z-index: 1;
    filter: grayscale(100%);
    transition: filter .1s cubic-bezier(0, 0, 0.2, 1);
    border: 0;
}

lite-youtube:hover > .lyt-playbtn,
lite-youtube .lyt-playbtn:focus {
    filter: none;
}

/* Post-click styles */
lite-youtube.lyt-activated {
    cursor: unset;
}
lite-youtube.lyt-activated::before,
lite-youtube.lyt-activated > .lyt-playbtn {
    opacity: 0;
    pointer-events: none;
}

.lyt-visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

.left-footer {
	color: #4c4c4c;
	font-size: 0.8rem;
    padding-top: 50px;
	padding-bottom: 30px;
}

.left-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    margin-bottom: 10px;
	margin-top: 5px;
}

body.theme-dark .left-footer-links a {
    color: #c5c5c5;
}
body.theme-dark .left-footer {
	color: #c5c5c5;
}

.left-footer-links a {
    display: inline-block;
    font-size: 0.8rem;
	text-decoration: none;
	color: #4c4c4c;
}
.left-footer-links a:hover {
    text-decoration: underline;
}

.left-footer-meta {
    border-top: 1px solid rgba(128,128,128,0.2);
    padding-top: 10px;
}

.vote-up-num {
    color: #01af14;
    font-size: 0.7rem;
}
.vote-down-num {
    color: #e74c3c;
    font-size: 0.7rem;
}
.comment-actions .reply-btn-guest {
    background: none;
    border: 1px dashed #aaa;
    color: #888;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: 0.2s;
}
.comment-actions .reply-btn-guest:hover {
    color: #555;
    border-color: #666;
}

.bot-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 10px 0;
    font-size: 0.85rem;
    color: #888;
    animation: bot-pulse 1.6s ease-in-out infinite;
}
.bot-thinking img {
    vertical-align: middle;
}
@keyframes bot-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
body.theme-dark .bot-thinking {
    color: #b9c4d0;
}

/* Тёмная тема */
body.theme-dark .comment-actions .reply-btn-guest {
    color: #999;
    border-color: #555;
}
body.theme-dark .comment-actions .reply-btn-guest:hover {
    color: #ccc;
    border-color: #888;
}
figure {
    margin: 0 0 1em 0;
}
figure a {
    display: inline-block;
    text-decoration: none;
}
figcaption {
    font-size: 0.8rem;
    padding-top: 6px;
    line-height: 1.4;
}
/* Штрих-пунктирное подчёркивание и курсор */
.spoiler-title {
  text-decoration: underline dotted #333;
  text-underline-offset: 0.2em;
  cursor: pointer;
  user-select: none;
  display: inline-block; /* чтобы подчёркивание было только под текстом */
}

/* Тело спойлера по умолчанию скрыто */
.spoiler-body {
  display: none;
  margin-top: 0.5em; /* отступ для красоты */
}

/* Класс, который добавляется при открытии */
.spoiler-body.open {
  display: block;
}
code {
  display: block;           /* каждый <code> — с новой строки (если их несколько) */
  background: #f0f0f0;
  padding: 0.5em 1em;
  margin: 0.3em 0;
  border-left: 4px solid #007acc;
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
  white-space: pre-wrap;
  word-break: break-all;
}
body.theme-dark code {
  background-color: #2d2d2d;        /* тёмный фон */
  color: #f8c555;                   /* тёплый жёлтый для текста */
  border: 1px solid #444;           /* едва заметная рамка */
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.9em;
}

/* ---- Тёмная тема для блоков кода (если используете <pre><code>) ---- */
body.theme-dark pre {
  background: #1e1e1e;              /* глубокий тёмный фон */
  color: #d4d4d4;                   /* светлый текст */
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1.2em;
  overflow-x: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  line-height: 1.7;
}

body.theme-dark pre code {
  background: transparent;          /* убираем фон, потому что он уже у pre */
  color: inherit;                   /* наследуем цвет от pre */
  padding: 0;
  border: none;
  font-size: inherit;
  display: block;
  white-space: pre-wrap;            /* перенос длинных строк (или оставьте pre) */
}
button.deepblue.clickbut {
    padding: 4px;
}
/* Базовый стиль для всех иконок */
i.fa {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    /* убираем возможные дефолтные стили i */
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
}

/* Сопоставление классов с id в спрайте */
i.fa.fa-play { mask-image: url('/img/icons.svg#icon-play'); -webkit-mask-image: url('/img/icons.svg#icon-play'); }
i.fa.fa-youtube { mask-image: url('/img/icons.svg#icon-youtube'); -webkit-mask-image: url('/img/icons.svg#icon-youtube'); }
i.fa.fa-check { mask-image: url('/img/icons.svg#icon-check'); -webkit-mask-image: url('/img/icons.svg#icon-check'); }
i.fa.fa-times { mask-image: url('/img/icons.svg#icon-x'); -webkit-mask-image: url('/img/icons.svg#icon-x'); } /* используем icon-x */
i.fa.fa-terminal { mask-image: url('/img/icons.svg#icon-terminal'); -webkit-mask-image: url('/img/icons.svg#icon-terminal'); }
i.fa.fa-star { mask-image: url('/img/icons.svg#icon-star'); -webkit-mask-image: url('/img/icons.svg#icon-star'); }
i.fa.fa-external-link { mask-image: url('/img/icons.svg#icon-external-link'); -webkit-mask-image: url('/img/icons.svg#icon-external-link'); }
i.fa.fa-calendar { mask-image: url('/img/icons.svg#icon-calendar'); -webkit-mask-image: url('/img/icons.svg#icon-calendar'); }
i.fa.fa-map-pin { mask-image: url('/img/icons.svg#icon-map-pin'); -webkit-mask-image: url('/img/icons.svg#icon-map-pin'); }
i.fa.fa-link { mask-image: url('/img/icons.svg#icon-link'); -webkit-mask-image: url('/img/icons.svg#icon-link'); } /* уже есть */
i.fa.fa-fire { mask-image: url('/img/icons.svg#icon-fire'); -webkit-mask-image: url('/img/icons.svg#icon-fire'); }
i.fa.fa-heart { mask-image: url('/img/icons.svg#icon-heart'); -webkit-mask-image: url('/img/icons.svg#icon-heart'); }
i.fa.fa-exclamation-triangle { mask-image: url('/img/icons.svg#icon-warning'); -webkit-mask-image: url('/img/icons.svg#icon-warning'); } /* используем icon-warning */
i.fa.fa-angle-double-right { mask-image: url('/img/icons.svg#icon-angle-double-right'); -webkit-mask-image: url('/img/icons.svg#icon-angle-double-right'); }
i.fa.fa-angle-right { mask-image: url('/img/icons.svg#icon-angle-right'); -webkit-mask-image: url('/img/icons.svg#icon-angle-right'); }
i.fa.fa-plus { mask-image: url('/img/icons.svg#icon-plus'); -webkit-mask-image: url('/img/icons.svg#icon-plus'); }
i.fa.fa-minus { mask-image: url('/img/icons.svg#icon-minus'); -webkit-mask-image: url('/img/icons.svg#icon-minus'); }
i.fa.fa-arrow-up { mask-image: url('/img/icons.svg#icon-arrow-up'); -webkit-mask-image: url('/img/icons.svg#icon-arrow-up'); }