/* ==========================================================================
   bbPress — форум в оформлении сайта
   Подключается только на страницах форума.
   ========================================================================== */

#bbpress-forums {
	font-family: var(--font, inherit);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
}

#bbpress-forums a {
	color: var(--accent);
	text-decoration: none;
}

#bbpress-forums a:hover {
	color: var(--accent-strong);
}

#bbpress-forums .bbp-author-avatar img {
	border-radius: 50%;
	vertical-align: middle;
}

/* --- Хлебные крошки ------------------------------------------------------ */

#bbpress-forums .bbp-breadcrumb {
	margin: 0 0 20px;
	font-size: 14px;
	color: var(--muted);
}

#bbpress-forums .bbp-breadcrumb p {
	margin: 0;
}

#bbpress-forums .bbp-breadcrumb a {
	color: var(--muted);
}

#bbpress-forums .bbp-breadcrumb a:hover {
	color: var(--accent);
}

#bbpress-forums .bbp-breadcrumb-sep {
	margin: 0 7px;
	opacity: 0.55;
}

#bbpress-forums .bbp-breadcrumb-current {
	color: var(--text-soft);
}

/* --- Уведомления --------------------------------------------------------- */

#bbpress-forums .bbp-template-notice {
	margin: 0 0 18px;
	padding: 12px 16px;
	background: var(--accent-soft);
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--text-soft);
	font-size: 14.5px;
}

#bbpress-forums .bbp-template-notice ul,
#bbpress-forums .bbp-template-notice ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

#bbpress-forums .bbp-template-notice li {
	margin: 0;
}

#bbpress-forums .bbp-template-notice p {
	margin: 0;
}

#bbpress-forums .bbp-template-notice.error,
#bbpress-forums .bbp-template-notice.warning {
	background: #fcefec;
	border-color: #f0d5cf;
	color: #8a3729;
}

@media (prefers-color-scheme: dark) {
	#bbpress-forums .bbp-template-notice.error,
	#bbpress-forums .bbp-template-notice.warning {
		background: #3a2320;
		border-color: #5c3a33;
		color: #f0c7bd;
	}
}

/* --- Списки форумов и тем ------------------------------------------------ */

#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies,
#bbpress-forums ul.bbp-search-results {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

/* Шапка таблицы */
#bbpress-forums li.bbp-header {
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
}

#bbpress-forums li.bbp-header ul {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 12px 20px;
	list-style: none;
}

#bbpress-forums li.bbp-header li {
	margin: 0;
	color: var(--muted);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#bbpress-forums li.bbp-footer {
	display: none;
}

/* Строки */
#bbpress-forums li.bbp-body {
	margin: 0;
	padding: 0;
	list-style: none;
	background: transparent;
}

#bbpress-forums li.bbp-body > ul {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 0;
	padding: 18px 20px;
	list-style: none;
	border-bottom: 1px solid var(--border);
	color: var(--text-soft);
	transition: background-color 0.15s ease;
}

#bbpress-forums li.bbp-body > ul:last-child {
	border-bottom: 0;
}

#bbpress-forums li.bbp-body > ul:hover {
	background: var(--surface-2);
}

/* Колонки */
#bbpress-forums .bbp-forum-info,
#bbpress-forums .bbp-topic-title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

#bbpress-forums .bbp-forum-topic-count,
#bbpress-forums .bbp-forum-reply-count,
#bbpress-forums .bbp-topic-voice-count,
#bbpress-forums .bbp-topic-reply-count {
	flex: 0 0 84px;
	margin: 0;
	text-align: center;
	color: var(--muted);
	font-size: 14.5px;
	font-variant-numeric: tabular-nums;
}

#bbpress-forums .bbp-forum-freshness,
#bbpress-forums .bbp-topic-freshness {
	flex: 0 0 210px;
	margin: 0;
	text-align: right;
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.5;
}

#bbpress-forums .bbp-topic-freshness a,
#bbpress-forums .bbp-forum-freshness a {
	color: var(--muted);
}

#bbpress-forums .bbp-forum-title,
#bbpress-forums .bbp-topic-permalink {
	display: inline-block;
	color: var(--text);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
}

#bbpress-forums .bbp-forum-title:hover,
#bbpress-forums .bbp-topic-permalink:hover {
	color: var(--accent);
}

#bbpress-forums .bbp-forum-content {
	margin: 4px 0 0;
	color: var(--muted);
	font-size: 14px;
}

#bbpress-forums .bbp-topic-meta {
	margin: 4px 0 0;
	font-size: 13.5px;
	color: var(--muted);
}

#bbpress-forums .bbp-topic-meta a {
	color: var(--text-soft);
}

#bbpress-forums .bbp-forums-list {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13.5px;
}

#bbpress-forums .bbp-forums-list li {
	display: inline-block;
	margin: 0 12px 4px 0;
}

#bbpress-forums .bbp-forums-list a {
	color: var(--text-soft);
}

#bbpress-forums .bbp-forums-list a:hover {
	color: var(--accent);
}

/* --- Тело темы ----------------------------------------------------------- */

#bbpress-forums ul.bbp-replies li.bbp-header {
	display: flex;
	gap: 26px;
	padding: 12px 20px;
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
	color: var(--muted);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#bbpress-forums ul.bbp-replies li.bbp-body {
	padding: 0;
}

#bbpress-forums .bbp-reply-header {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 9px 20px;
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
	color: var(--muted);
	font-size: 13px;
}

#bbpress-forums .bbp-reply-permalink {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

#bbpress-forums li.bbp-body > .type-topic,
#bbpress-forums li.bbp-body > .type-reply {
	display: flex;
	align-items: flex-start;
	gap: 26px;
	padding: 22px 20px;
	border-bottom: 1px solid var(--border);
	background: transparent;
}

#bbpress-forums li.bbp-body > div:last-child {
	border-bottom: 0;
}

#bbpress-forums .bbp-reply-author {
	flex: 0 0 170px;
	margin: 0;
	text-align: center;
	font-size: 14px;
}

#bbpress-forums ul.bbp-replies .bbp-author-avatar img {
	display: block;
	margin: 0 auto 10px;
	width: 64px;
	height: 64px;
}

#bbpress-forums ul.bbp-replies .bbp-author-name {
	display: block;
	color: var(--text);
	font-weight: 700;
}

#bbpress-forums .bbp-template-notice .bbp-author-link {
	white-space: nowrap;
}

#bbpress-forums .bbp-author-role {
	margin-top: 2px;
	color: var(--muted);
	font-size: 12.5px;
}

#bbpress-forums .bbp-reply-content {
	flex: 1 1 auto;
	min-width: 0;
	color: var(--text-soft);
}

#bbpress-forums .bbp-reply-content p:last-child {
	margin-bottom: 0;
}

#bbpress-forums .bbp-reply-content ul,
#bbpress-forums .bbp-reply-content ol {
	padding-left: 1.3em;
}

#bbpress-forums .bbp-reply-content blockquote {
	margin: 1.2em 0;
	padding-left: 16px;
	border-left: 3px solid var(--accent);
	color: var(--muted);
}

#bbpress-forums .bbp-reply-content code {
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--surface-2);
	font-family: var(--mono, monospace);
	font-size: 0.9em;
}

#bbpress-forums .bbp-reply-content img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

/* --- Пагинация ----------------------------------------------------------- */

#bbpress-forums .bbp-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 14px 0;
	color: var(--muted);
	font-size: 14px;
}

#bbpress-forums .bbp-pagination-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

#bbpress-forums .bbp-pagination-links a,
#bbpress-forums .bbp-pagination-links span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid var(--border);
	border-radius: 9px;
	background: var(--surface);
	color: var(--text-soft);
	font-size: 13.5px;
	font-weight: 600;
}

#bbpress-forums .bbp-pagination-links a:hover {
	border-color: var(--accent);
	color: var(--accent);
}

#bbpress-forums .bbp-pagination-links span.current {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

/* --- Формы --------------------------------------------------------------- */

#bbpress-forums fieldset.bbp-form,
#bbpress-forums .bbp-form {
	margin: 0 0 20px;
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: var(--shadow-sm);
}

#bbpress-forums legend {
	padding: 0 8px;
	color: var(--text);
	font-weight: 700;
	font-size: 17px;
}

#bbpress-forums fieldset.bbp-form p,
#bbpress-forums .bbp-form p {
	margin: 0 0 14px;
}

#bbpress-forums label {
	display: inline-block;
	margin-bottom: 5px;
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 600;
}

#bbpress-forums input[type="text"],
#bbpress-forums input[type="password"],
#bbpress-forums input[type="email"],
#bbpress-forums input[type="url"],
#bbpress-forums input[type="search"],
#bbpress-forums input[type="number"],
#bbpress-forums textarea,
#bbpress-forums select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	color: var(--text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#bbpress-forums input:focus,
#bbpress-forums textarea:focus,
#bbpress-forums select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

#bbpress-forums textarea {
	min-height: 160px;
	resize: vertical;
}

#bbpress-forums input[type="submit"],
#bbpress-forums .bbp-submit-wrapper .button,
#bbpress-forums fieldset.bbp-form .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	background: var(--accent);
	border: 1px solid var(--accent);
	border-radius: 10px;
	color: #fff;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

#bbpress-forums input[type="submit"]:hover,
#bbpress-forums .bbp-submit-wrapper .button:hover,
#bbpress-forums fieldset.bbp-form .button:hover {
	background: var(--accent-strong);
	border-color: var(--accent-strong);
	color: #fff;
}

#bbpress-forums .ed_button,
#bbpress-forums .quicktags-toolbar .button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 4px 10px !important;
	background: var(--surface) !important;
	border: 1px solid var(--border-strong) !important;
	border-radius: 7px !important;
	color: var(--text-soft) !important;
	font-family: inherit !important;
	font-size: 12.5px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	box-shadow: none !important;
	cursor: pointer;
}

#bbpress-forums .ed_button:hover,
#bbpress-forums .quicktags-toolbar .button:hover {
	background: var(--surface-2) !important;
	border-color: var(--accent) !important;
	color: var(--accent) !important;
}

#bbpress-forums .bbp-submit-wrapper {
	margin-top: 6px;
	text-align: right;
}

/* --- Форма входа bbPress ------------------------------------------------- */

#bbpress-forums .bbp-login-form {
	max-width: 460px;
	margin: 0 0 20px;
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: var(--shadow-sm);
}

#bbpress-forums .bbp-login-form fieldset {
	padding: 0;
	border: 0;
}

#bbpress-forums .bbp-login-form legend {
	display: none;
}

#bbpress-forums .bbp-login-form .bbp-username,
#bbpress-forums .bbp-login-form .bbp-password,
#bbpress-forums .bbp-login-form .bbp-remember-me {
	margin: 0 0 12px;
}

#bbpress-forums .bbp-login-form .bbp-remember-me label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
}

#bbpress-forums .bbp-login-form input[type="checkbox"] {
	width: auto;
}

/* --- Поиск --------------------------------------------------------------- */

#bbpress-forums .bbp-search-form {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 16px;
}

#bbpress-forums .bbp-search-form form {
	width: min(420px, 100%);
}

#bbpress-forums .bbp-search-form form > div {
	display: flex;
	gap: 8px;
	align-items: center;
}

#bbpress-forums .bbp-search-form input[type="search"] {
	flex: 1 1 auto;
}

/* --- Служебное ----------------------------------------------------------- */

#bbpress-forums .bbp-no-reply,
#bbpress-forums .bbp-no-topic {
	margin: 0 0 20px;
}

#bbpress-forums .bbp-topic-tags {
	font-size: 14px;
	color: var(--muted);
}

#bbpress-forums .bbp-topic-description a {
	color: var(--text-soft);
}

#bbpress-forums .bbp-admin-links a {
	font-size: 13px;
}

/* --- Адаптивность -------------------------------------------------------- */

@media (max-width: 780px) {
	#bbpress-forums li.bbp-header,
	#bbpress-forums li.bbp-footer {
		display: none;
	}

	#bbpress-forums li.bbp-forum,
	#bbpress-forums li.bbp-topic {
		flex-wrap: wrap;
		gap: 8px 16px;
	}

	#bbpress-forums .bbp-forum-info,
	#bbpress-forums .bbp-topic-title {
		flex: 1 0 100%;
	}

	#bbpress-forums .bbp-forum-topic-count,
	#bbpress-forums .bbp-forum-reply-count,
	#bbpress-forums .bbp-topic-voice-count,
	#bbpress-forums .bbp-topic-reply-count {
		flex: 0 0 auto;
		font-size: 13px;
	}

	#bbpress-forums .bbp-forum-freshness,
	#bbpress-forums .bbp-topic-freshness {
		flex: 1 0 100%;
		text-align: left;
	}

	#bbpress-forums li.bbp-body > .type-topic,
	#bbpress-forums li.bbp-body > .type-reply {
		flex-direction: column;
		gap: 14px;
	}

	#bbpress-forums .bbp-reply-author {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		gap: 12px;
		text-align: left;
	}

	#bbpress-forums ul.bbp-replies .bbp-author-avatar img {
		margin: 0;
		width: 44px;
		height: 44px;
	}

	#bbpress-forums .bbp-pagination {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* --- Профиль пользователя ------------------------------------------------ */

#bbpress-forums #bbp-user-wrapper {
	display: flex;
	align-items: flex-start;
	gap: 32px;
}

#bbpress-forums #bbp-single-user-details {
	flex: 0 0 220px;
}

#bbpress-forums #bbp-user-avatar img {
	display: block;
	width: 150px;
	height: 150px;
	border-radius: 20px;
}

#bbpress-forums #bbp-user-navigation ul {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

#bbpress-forums #bbp-user-navigation li {
	margin: 0;
}

#bbpress-forums #bbp-user-navigation a {
	display: block;
	padding: 8px 12px;
	border-radius: 8px;
	color: var(--text-soft);
	font-size: 14.5px;
}

#bbpress-forums #bbp-user-navigation a:hover {
	background: var(--surface-2);
	color: var(--text);
}

#bbpress-forums #bbp-user-navigation li.current a {
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 600;
}

#bbpress-forums #bbp-user-body {
	flex: 1 1 auto;
	min-width: 0;
	padding: 28px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: var(--shadow-sm);
}

#bbpress-forums #bbp-user-body h2 {
	margin: 0 0 18px;
	font-size: 22px;
}

#bbpress-forums .bbp-user-section h3 {
	margin: 10px 0 8px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#bbpress-forums .bbp-user-section p {
	margin: 0 0 6px;
	color: var(--text-soft);
}

#bbpress-forums .bbp-user-section hr {
	margin: 22px 0;
	border: 0;
	border-top: 1px solid var(--border);
}

@media (max-width: 780px) {
	#bbpress-forums #bbp-user-wrapper {
		flex-direction: column;
		gap: 20px;
	}

	#bbpress-forums #bbp-user-avatar img {
		width: 96px;
		height: 96px;
	}

	#bbpress-forums #bbp-user-body {
		padding: 20px;
	}
}

/* --- Редактор: контейнер и панель кнопок --------------------------------- */

#bbpress-forums .wp-editor-container {
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
	background: var(--surface);
}

#bbpress-forums .quicktags-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px;
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
}

#bbpress-forums .wp-editor-area,
#bbpress-forums .wp-editor-area:focus {
	display: block;
	width: 100%;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

/* --- Подсказка и шпаргалка ----------------------------------------------- */

#bbpress-forums .format-hint {
	margin: 12px 0 0;
	color: var(--muted);
	font-size: 13.5px;
	line-height: 1.55;
}

#bbpress-forums .format-help {
	margin: 10px 0 18px;
	padding: 0 14px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 12px;
}

#bbpress-forums .format-help summary {
	padding: 10px 0;
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

#bbpress-forums .format-help summary:hover {
	color: var(--accent);
}

#bbpress-forums .format-help dl {
	display: grid;
	gap: 8px;
	margin: 0 0 12px;
}

#bbpress-forums .format-help dl > div {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 12px;
	align-items: baseline;
}

#bbpress-forums .format-help dt {
	color: var(--text-soft);
	font-size: 13.5px;
	font-weight: 600;
}

#bbpress-forums .format-help dd {
	margin: 0;
	min-width: 0;
}

#bbpress-forums .format-help code {
	display: inline-block;
	max-width: 100%;
	padding: 3px 7px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 7px;
	color: var(--text-soft);
	font-family: var(--mono, monospace);
	font-size: 12.5px;
	overflow-wrap: anywhere;
}

#bbpress-forums .format-help-note {
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 12.5px;
}

@media (max-width: 640px) {
	#bbpress-forums .format-help dl > div {
		grid-template-columns: 1fr;
		gap: 2px;
	}
}

/* --- Предпросмотр сообщения ---------------------------------------------- */

#bbpress-forums .format-preview-actions {
	margin: 10px 0 0;
}

#bbpress-forums .format-preview-toggle {
	padding: 8px 16px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	color: var(--text-soft);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

#bbpress-forums .format-preview-toggle:hover {
	background: var(--surface-2);
	border-color: var(--accent);
	color: var(--accent);
}

#bbpress-forums .format-preview {
	margin: 12px 0 18px;
	padding: 18px 20px;
	background: var(--surface);
	border: 1px dashed var(--border-strong);
	border-radius: 12px;
	color: var(--text-soft);
	font-size: 15.5px;
	line-height: 1.65;
}

#bbpress-forums .format-preview[hidden] {
	display: none;
}

#bbpress-forums .format-preview p {
	margin: 0 0 10px;
}

#bbpress-forums .format-preview p:last-child {
	margin-bottom: 0;
}

#bbpress-forums .format-preview ul,
#bbpress-forums .format-preview ol {
	margin: 0 0 10px;
	padding-left: 1.35em;
}

#bbpress-forums .format-preview li {
	margin: 3px 0;
}

#bbpress-forums .format-preview blockquote {
	margin: 1em 0;
	padding: 2px 0 2px 14px;
	border-left: 3px solid var(--accent);
	color: var(--muted);
}

#bbpress-forums .format-preview code {
	padding: 2px 6px;
	background: var(--surface-2);
	border-radius: 6px;
	font-family: var(--mono, monospace);
	font-size: 0.9em;
}

#bbpress-forums .format-preview pre {
	overflow-x: auto;
	padding: 12px 14px;
	background: var(--surface-2);
	border-radius: 10px;
}

#bbpress-forums .format-preview img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

#bbpress-forums .format-preview a {
	color: var(--accent);
}

#bbpress-forums .format-preview-empty {
	margin: 0;
	color: var(--muted);
	font-style: italic;
}

/* --- Дополнительные элементы панели: заголовки и цвет -------------------- */

#bbpress-forums .quicktags-toolbar select.format-select {
	width: auto !important;
	max-width: none;
	height: auto !important;
	padding: 5px 8px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: 7px;
	color: var(--text-soft);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
}

#bbpress-forums .quicktags-toolbar select.format-select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px var(--accent-soft);
	outline: none;
}

#bbpress-forums .format-sep {
	align-self: stretch;
	width: 1px;
	margin: 0 2px;
	background: var(--border-strong);
}

/* --- Таблицы и дополнительные теги в сообщениях и предпросмотре ---------- */

#bbpress-forums .format-preview table,
#bbpress-forums .bbp-reply-content table {
	width: 100%;
	margin: 0 0 14px;
	border-collapse: collapse;
	font-size: 15px;
}

#bbpress-forums .format-preview caption,
#bbpress-forums .bbp-reply-content caption {
	caption-side: top;
	padding: 6px 0;
	color: var(--muted);
	font-size: 13.5px;
	text-align: left;
}

#bbpress-forums .format-preview th,
#bbpress-forums .format-preview td,
#bbpress-forums .bbp-reply-content th,
#bbpress-forums .bbp-reply-content td {
	padding: 8px 12px;
	border: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

#bbpress-forums .format-preview th,
#bbpress-forums .bbp-reply-content th {
	background: var(--surface-2);
	font-weight: 700;
}

#bbpress-forums .format-preview hr,
#bbpress-forums .bbp-reply-content hr {
	margin: 20px 0;
	border: 0;
	border-top: 1px solid var(--border);
}

#bbpress-forums .format-preview dl,
#bbpress-forums .bbp-reply-content dl {
	margin: 0 0 14px;
}

#bbpress-forums .format-preview dt,
#bbpress-forums .bbp-reply-content dt {
	font-weight: 700;
}

#bbpress-forums .format-preview dd,
#bbpress-forums .bbp-reply-content dd {
	margin: 0 0 8px 1.4em;
}

#bbpress-forums .format-preview figure,
#bbpress-forums .bbp-reply-content figure {
	margin: 0 0 14px;
}

#bbpress-forums .format-preview figcaption,
#bbpress-forums .bbp-reply-content figcaption {
	margin-top: 6px;
	color: var(--muted);
	font-size: 13px;
}

#bbpress-forums .format-preview details,
#bbpress-forums .bbp-reply-content details {
	margin: 0 0 14px;
}

#bbpress-forums .format-preview summary,
#bbpress-forums .bbp-reply-content summary {
	font-weight: 600;
	cursor: pointer;
}

#bbpress-forums .format-preview mark,
#bbpress-forums .bbp-reply-content mark {
	padding: 0 3px;
	background: var(--accent-soft);
	color: inherit;
	border-radius: 3px;
}

#bbpress-forums .format-preview kbd,
#bbpress-forums .bbp-reply-content kbd {
	padding: 1px 6px;
	background: var(--surface-2);
	border: 1px solid var(--border-strong);
	border-bottom-width: 2px;
	border-radius: 5px;
	font-family: var(--mono, monospace);
	font-size: 0.85em;
}

#bbpress-forums .format-preview sub,
#bbpress-forums .format-preview sup,
#bbpress-forums .bbp-reply-content sub,
#bbpress-forums .bbp-reply-content sup {
	font-size: 75%;
	line-height: 0;
}

/* --- Иконки в панели оформления ------------------------------------------ */

/*
 * Штатные кнопки остаются в разметке, но уводятся за экран.
 * Скрывать их через display:none нельзя: Quicktags игнорирует клики
 * по невидимым кнопкам (проверяет clientWidth/offsetWidth).
 */
#bbpress-forums .ed_button.format-native {
	position: absolute !important;
	left: -9999px !important;
	width: 20px !important;
	height: 20px !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

#bbpress-forums .ed-button-rich {
	gap: 6px;
}

#bbpress-forums .format-icon {
	width: 15px;
	height: 15px;
	flex: none;
}

#bbpress-forums .ed-button-rich span {
	white-space: nowrap;
}

/* --- Метки темы ---------------------------------------------------------- */

#bbpress-forums .topic-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 16px;
	color: var(--muted);
	font-size: 13.5px;
}

#bbpress-forums .topic-tags-label {
	font-weight: 600;
}

#bbpress-forums .topic-tags a {
	display: inline-block;
	padding: 3px 10px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--text-soft);
	font-size: 12.5px;
	text-decoration: none;
}

#bbpress-forums .topic-tags a:hover {
	border-color: var(--accent);
	color: var(--accent);
}

#bbpress-forums .tags-hint {
	margin: 6px 0 0;
}

/* Метки выводятся нашей разметкой над темой, встроенный блок скрываем. */
#bbpress-forums .bbp-topic-tags {
	display: none;
}

/* --- Редактирование профиля ---------------------------------------------- */

#bbpress-forums #bbp-your-profile {
	margin: 0;
}

#bbpress-forums #bbp-your-profile fieldset,
#bbpress-forums #bbp-your-profile fieldset.bbp-form {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

#bbpress-forums #bbp-your-profile legend {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

#bbpress-forums #bbp-your-profile h2,
#bbpress-forums #bbp-your-profile h2.entry-title {
	display: block;
	margin: 22px 0 0;
	padding: 14px 18px;
	background: var(--surface-2);
	border-radius: 12px 12px 0 0;
	color: var(--text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

#bbpress-forums #bbp-your-profile h2:first-of-type {
	margin-top: 0;
}

#bbpress-forums #bbp-your-profile h2 + fieldset.bbp-form {
	margin: 0 0 18px;
	padding: 20px;
	background: var(--bg);
	border-radius: 0 0 12px 12px;
}

#bbpress-forums #bbp-your-profile fieldset > div {
	margin: 0 0 16px;
}

#bbpress-forums #bbp-your-profile fieldset > div:last-child {
	margin-bottom: 0;
}

#bbpress-forums #bbp-your-profile label {
	display: block;
	margin: 0 0 6px;
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 600;
}

#bbpress-forums #bbp-your-profile input[type="text"],
#bbpress-forums #bbp-your-profile input[type="password"],
#bbpress-forums #bbp-your-profile input[type="email"],
#bbpress-forums #bbp-your-profile input[type="url"],
#bbpress-forums #bbp-your-profile input[type="search"],
#bbpress-forums #bbp-your-profile input[type="number"],
#bbpress-forums #bbp-your-profile textarea,
#bbpress-forums #bbp-your-profile select {
	width: 100%;
	max-width: 520px;
	padding: 11px 13px;
	background: var(--surface);
	border: 1px solid transparent;
	border-radius: 9px;
	box-shadow: none;
	color: var(--text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#bbpress-forums #bbp-your-profile textarea {
	min-height: 120px;
	resize: vertical;
}

#bbpress-forums #bbp-your-profile input[type="text"]:focus,
#bbpress-forums #bbp-your-profile input[type="password"]:focus,
#bbpress-forums #bbp-your-profile input[type="email"]:focus,
#bbpress-forums #bbp-your-profile input[type="url"]:focus,
#bbpress-forums #bbp-your-profile textarea:focus,
#bbpress-forums #bbp-your-profile select:focus {
	background: var(--surface);
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
	outline: none;
}

#bbpress-forums #bbp-your-profile input:disabled,
#bbpress-forums #bbp-your-profile input:read-only {
	background: transparent;
	border: 1px dashed var(--border-strong);
	color: var(--muted);
	cursor: not-allowed;
}

#bbpress-forums #bbp-your-profile div:has(> input:disabled) > label::after {
	content: "только чтение";
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	background: var(--surface-2);
	border-radius: 999px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	vertical-align: middle;
}

/* Пароль */

#bbpress-forums #bbp-your-profile #password > label {
	display: block;
	margin-bottom: 8px;
}

#bbpress-forums #bbp-your-profile .wp-generate-pw {
	margin: 0;
}

#bbpress-forums #bbp-your-profile fieldset.password {
	margin-top: 12px;
}

#bbpress-forums #bbp-your-profile .password-input-wrapper {
	display: block;
}

#bbpress-forums #bbp-your-profile .password-input-wrapper::before {
	content: "Новый пароль";
	display: block;
	margin: 0 0 6px;
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 600;
}

#bbpress-forums #bbp-your-profile fieldset.password.hide-if-js {
	display: none;
}

#bbpress-forums #bbp-your-profile #pass-strength-result:empty,
#bbpress-forums #bbp-your-profile #pass-strength-result.empty {
	display: none;
}

#bbpress-forums #bbp-your-profile .password-button-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

#bbpress-forums #bbp-your-profile .password-button-wrapper .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

/* Кнопки */

#bbpress-forums #bbp-your-profile .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 9px 14px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: 9px;
	box-shadow: none;
	color: var(--text-soft);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#bbpress-forums #bbp-your-profile .button:hover {
	background: var(--surface-2);
	border-color: var(--accent);
	color: var(--text);
}

#bbpress-forums #bbp-your-profile #bbp_user_edit_submit {
	padding: 11px 22px;
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	font-size: 14.5px;
}

#bbpress-forums #bbp-your-profile #bbp_user_edit_submit:hover {
	background: var(--accent-strong);
	border-color: var(--accent-strong);
	color: #fff;
}

/* Подсказки и индикатор пароля */

#bbpress-forums #bbp-your-profile .description,
#bbpress-forums #bbp-your-profile .indicator-hint {
	max-width: 560px;
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.5;
}

#bbpress-forums #bbp-your-profile #pass-strength-result {
	width: 100%;
	max-width: 520px;
	margin: 10px 0 0;
	padding: 8px 10px;
	background: var(--surface-2);
	border: 1px solid transparent;
	border-radius: 8px;
	color: var(--text-soft);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

#bbpress-forums #bbp-your-profile #pass-strength-result.strong {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent-strong);
}

#bbpress-forums #bbp-your-profile #pass-strength-result.good {
	background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
	border-color: var(--accent);
	color: var(--text-soft);
}

#bbpress-forums #bbp-your-profile #pass-strength-result.bad,
#bbpress-forums #bbp-your-profile #pass-strength-result.short {
	background: #fbeaea;
	border-color: #b32d2e;
	color: #8a2324;
}

#bbpress-forums #bbp-your-profile .pw-weak {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 6px 8px;
	margin: 12px 0 0;
}

#bbpress-forums #bbp-your-profile .pw-weak label {
	grid-column: 1;
	grid-row: 1;
	margin: 0;
}

#bbpress-forums #bbp-your-profile .pw-weak input[type="checkbox"] {
	grid-column: 2;
	grid-row: 1;
	justify-self: start;
	margin: 0;
}

#bbpress-forums #bbp-your-profile .pw-weak .description {
	grid-column: 1 / -1;
	grid-row: 2;
	margin-top: 0;
}

/* Таблица полей Minecraft */

#bbpress-forums #bbp-your-profile .form-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
}

#bbpress-forums #bbp-your-profile .form-table th,
#bbpress-forums #bbp-your-profile .form-table td {
	display: block;
	width: auto;
	padding: 0;
	text-align: left;
}

#bbpress-forums #bbp-your-profile .form-table th {
	padding-bottom: 6px;
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 600;
}

#bbpress-forums #bbp-your-profile .form-table td {
	padding: 0;
}

#bbpress-forums #bbp-your-profile h2 + .form-table {
	display: block;
	margin: 0 0 18px;
	padding: 0;
	background: var(--bg);
	border-radius: 0 0 12px 12px;
}

#bbpress-forums #bbp-your-profile h2 + .form-table th {
	padding: 20px 20px 6px;
}

#bbpress-forums #bbp-your-profile h2 + .form-table td {
	padding: 0 20px 20px;
}

/* Кнопка сохранения */

#bbpress-forums #bbp-your-profile fieldset.submit {
	margin-top: 0;
}

#bbpress-forums #bbp-your-profile fieldset.submit div {
	margin: 0;
}

@media (max-width: 600px) {
	#bbpress-forums #bbp-your-profile input[type="text"],
	#bbpress-forums #bbp-your-profile input[type="password"],
	#bbpress-forums #bbp-your-profile input[type="email"],
	#bbpress-forums #bbp-your-profile input[type="url"],
	#bbpress-forums #bbp-your-profile textarea,
	#bbpress-forums #bbp-your-profile select {
		max-width: none;
		font-size: 16px;
	}

	#bbpress-forums #bbp-your-profile #pass-strength-result {
		max-width: none;
	}
}
