:root {
	/* Palette aligned to the Medvisement logo (blue #256ea0→#1797d6, cyan #28b2eb, indigo #495ea2). */
	--med-color-bg: #f3f7fb;
	--med-color-surface: #ffffff;
	--med-color-surface-muted: #eef4fb;
	--med-color-text: #16222e;
	--med-color-muted: #5d6b78;
	--med-color-border: #d8e2ec;
	--med-color-primary: #1583c4;
	--med-color-primary-strong: #0f6298;
	--med-color-accent: #28b2eb;
	--med-color-success: #2f7d57;
	--med-color-warning: #a86612;
	--med-color-danger: #b83a2e;
	--med-color-premium: #495ea2;
	--med-radius-sm: 4px;
	--med-radius-md: 8px;
	--med-radius-lg: 12px;
	--med-shadow-soft: 0 10px 30px rgba(16, 41, 67, 0.08);
	--med-focus: 0 0 0 3px rgba(21, 131, 196, 0.24);
}

.med-button,
.med-badge,
.med-chip,
.med-result-card,
.med-article-card,
.med-panel,
.med-state,
.med-app-header,
.med-mobile-nav {
	box-sizing: border-box;
}

.med-button {
	align-items: center;
	border: 1px solid transparent;
	border-radius: var(--med-radius-md);
	cursor: pointer;
	display: inline-flex;
	font-size: 14px;
	font-weight: 700;
	gap: 8px;
	justify-content: center;
	line-height: 1.2;
	min-height: 42px;
	padding: 11px 16px;
	text-decoration: none;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
	white-space: nowrap;
}

.med-button:focus-visible,
.med-badge:focus-visible,
.med-chip:focus-visible,
.med-result-card a:focus-visible,
.med-article-card a:focus-visible,
.med-search-box input:focus-visible,
.med-search-box button:focus-visible,
.med-filter-panel a:focus-visible,
.med-mobile-nav a:focus-visible {
	box-shadow: var(--med-focus);
	outline: none;
}

.med-button--primary {
	background: var(--med-color-primary);
	color: #fff;
}

.med-button--primary:hover {
	background: var(--med-color-primary-strong);
	color: #fff;
}

.med-button--secondary {
	background: var(--med-color-surface);
	border-color: var(--med-color-border);
	color: var(--med-color-text);
}

.med-button--secondary:hover {
	border-color: var(--med-color-primary);
	color: var(--med-color-primary-strong);
}

.med-button--ghost {
	background: transparent;
	color: var(--med-color-primary);
}

.med-button--premium {
	background: var(--med-color-premium);
	color: #fff;
}

.med-badge {
	align-items: center;
	border: 1px solid var(--med-color-border);
	border-radius: 999px;
	color: var(--med-color-text);
	display: inline-flex;
	font-size: 12px;
	font-weight: 800;
	gap: 6px;
	letter-spacing: 0;
	line-height: 1.1;
	min-height: 28px;
	padding: 7px 10px;
	text-decoration: none;
	white-space: nowrap;
}

.med-badge--guest,
.med-badge--neutral {
	background: #f3f6f6;
	color: #39484b;
}

.med-badge--unverified,
.med-badge--free_limit_exhausted,
.med-badge--expiry_soon {
	background: #fff6e8;
	border-color: #f0d7ad;
	color: var(--med-color-warning);
}

.med-badge--verified,
.med-badge--article_access,
.med-badge--specialty_access {
	background: #eef9f2;
	border-color: #c9e8d3;
	color: var(--med-color-success);
}

.med-badge--premium {
	background: #eef0ff;
	border-color: #d6dcff;
	color: var(--med-color-premium);
}

.med-badge--danger,
.med-badge--payment_failed {
	background: #fff0ed;
	border-color: #facdc5;
	color: var(--med-color-danger);
}

.med-chip {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: 999px;
	color: var(--med-color-text);
	display: inline-flex;
	font-size: 13px;
	font-weight: 700;
	gap: 6px;
	min-height: 34px;
	padding: 8px 12px;
	text-decoration: none;
	white-space: nowrap;
}

.med-chip:hover,
.med-chip.is-active {
	background: var(--med-color-surface-muted);
	border-color: var(--med-color-primary);
	color: var(--med-color-primary-strong);
}

.med-app-header {
	background: rgba(255, 255, 255, 0.96);
	border-bottom: 1px solid var(--med-color-border);
	position: sticky;
	top: 0;
	z-index: 999;
}

.admin-bar .med-app-header {
	top: 32px;
}

.med-app-header__inner {
	align-items: center;
	display: grid;
	gap: 18px;
	grid-template-columns: auto minmax(260px, 1fr) auto auto;
	min-height: 70px;
}

.med-app-header__brand .logo {
	margin: 0;
}

.med-app-header__brand img {
	max-height: 42px;
	width: auto;
}

.med-app-header__nav #mainnav {
	float: none;
	position: static;
}

.med-app-header__nav #mainnav > ul {
	align-items: center;
	display: flex;
	gap: 4px;
	margin: 0;
}

.med-app-header__nav #mainnav > ul > li {
	float: none;
	margin: 0;
	padding: 0;
}

.med-app-header__nav #mainnav > ul > li > a {
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	padding: 10px 11px;
}

.med-app-header__nav #mainnav > ul > li.current-menu-item > a,
.med-app-header__nav #mainnav > ul > li > a:hover {
	background: var(--med-color-surface-muted);
	color: var(--med-color-primary-strong);
}

.med-app-header__actions {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.med-app-header__actions .button-auth,
.med-app-header__actions .button-register {
	align-items: center;
	border-radius: var(--med-radius-md);
	display: inline-flex;
	font-size: 14px;
	font-weight: 800;
	justify-content: center;
	min-height: 40px;
	padding: 10px 13px;
	text-decoration: none;
}

.med-app-header__actions .button-auth {
	background: var(--med-color-primary);
	color: #fff;
}

.med-app-header__actions .button-register {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	color: var(--med-color-text);
}

.med-app-header__actions .nav-item,
.med-app-header__actions .dropdown-toggle {
	color: var(--med-color-text);
}

.med-app-header__mobile-toggle {
	display: none;
}

.med-search-box {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	display: grid;
	gap: 8px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	min-height: 48px;
	padding: 4px 4px 4px 14px;
}

.med-search-box__icon {
	color: var(--med-color-muted);
	display: inline-flex;
}

.med-search-box input {
	background: transparent;
	border: 0;
	color: var(--med-color-text);
	font-size: 15px;
	height: 38px;
	min-width: 0;
	outline: none;
	padding: 0;
	width: 100%;
}

.med-search-box__field {
	align-items: center;
	display: flex;
	gap: 8px;
	min-width: 0;
}

.med-search-box__field i,
.med-search-box__scope i {
	color: var(--med-color-muted);
}

.med-search-box__scope {
	align-items: center;
	border-right: 1px solid var(--med-color-border);
	display: flex;
	gap: 8px;
	min-height: 38px;
	padding-right: 12px;
}

.med-search-box__scope select {
	background: transparent;
	border: 0;
	color: var(--med-color-text);
	font-size: 14px;
	font-weight: 700;
	outline: none;
}

.med-search-box input::placeholder {
	color: #849194;
}

.med-search-box--library {
	grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto;
	padding-left: 12px;
}

.med-search-box--compact {
	min-height: 44px;
}

.med-search-box--compact .med-button {
	min-height: 36px;
	padding: 8px 12px;
}

.med-mobile-nav {
	background: rgba(255, 255, 255, 0.97);
	border-top: 1px solid var(--med-color-border);
	bottom: 0;
	display: none;
	grid-template-columns: repeat(4, 1fr);
	left: 0;
	padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
	position: fixed;
	right: 0;
	z-index: 999;
}

.med-mobile-nav a {
	align-items: center;
	border-radius: var(--med-radius-md);
	color: var(--med-color-muted);
	display: flex;
	flex-direction: column;
	font-size: 11px;
	font-weight: 800;
	gap: 3px;
	justify-content: center;
	min-height: 48px;
	text-decoration: none;
}

.med-mobile-nav a.is-active,
.med-mobile-nav a:hover {
	background: var(--med-color-surface-muted);
	color: var(--med-color-primary-strong);
}

.med-search-page,
.med-library-page {
	background: var(--med-color-bg);
	margin-top: -1px;
	padding-bottom: 56px;
}

.med-page-hero {
	background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
	border-bottom: 1px solid var(--med-color-border);
	padding: 34px 0 26px;
}

.med-page-hero__head {
	align-items: flex-start;
	display: flex;
	gap: 20px;
	justify-content: space-between;
	margin-bottom: 18px;
}

.med-page-hero__title {
	color: var(--med-color-text);
	font-size: 34px;
	font-weight: 800;
	letter-spacing: 0;
	line-height: 1.15;
	margin: 0 0 8px;
}

.med-page-hero__subtitle {
	color: var(--med-color-muted);
	font-size: 16px;
	line-height: 1.55;
	margin: 0;
	max-width: 760px;
}

.med-scope-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.med-layout {
	display: grid;
	gap: 22px;
	grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
	padding: 24px 0 0;
}

.med-filter-panel,
.med-panel,
.med-state,
.med-result-card,
.med-article-card {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
}

.med-filter-panel {
	padding: 16px;
	position: sticky;
	top: 92px;
}

.admin-bar .med-filter-panel {
	top: 124px;
}

.med-filter-panel__title {
	color: var(--med-color-text);
	font-size: 16px;
	font-weight: 800;
	margin: 0 0 12px;
}

.med-filter-panel__nav {
	display: grid;
	gap: 6px;
}

.med-filter-panel__link {
	align-items: center;
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	display: flex;
	font-size: 14px;
	font-weight: 700;
	gap: 10px;
	justify-content: space-between;
	line-height: 1.25;
	padding: 9px 10px;
	text-decoration: none;
}

.med-filter-panel__link:hover,
.med-filter-panel__link.is-active {
	background: var(--med-color-surface-muted);
	color: var(--med-color-primary-strong);
}

.med-results {
	min-width: 0;
}

.med-results__head {
	align-items: center;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	margin-bottom: 14px;
}

.med-results__title {
	color: var(--med-color-text);
	font-size: 22px;
	font-weight: 800;
	margin: 0;
}

.med-results__count {
	color: var(--med-color-muted);
	font-size: 14px;
	margin: 0;
}

.med-result-list,
.med-article-list {
	display: grid;
	gap: 12px;
}

.med-result-card,
.med-article-card {
	padding: 18px;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.med-result-card:hover,
.med-article-card:hover {
	border-color: rgba(8, 125, 143, 0.45);
	box-shadow: var(--med-shadow-soft);
	transform: translateY(-1px);
}

.med-card-meta {
	align-items: center;
	color: var(--med-color-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	font-weight: 700;
	gap: 8px;
	margin-bottom: 9px;
}

.med-card-title {
	font-size: 20px;
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 8px;
}

.med-card-title a {
	color: var(--med-color-text);
	text-decoration: none;
}

.med-card-title a:hover {
	color: var(--med-color-primary-strong);
}

/* Перевод названия: статья английская, читатель ищет по-русски. */
.articles-catalog-card__translated {
	color: var(--med-color-muted, #5d6b78);
	font-size: 13px;
	line-height: 1.4;
	margin: 0;
}

.med-card-snippet {
	color: #3c4b4f;
	font-size: 15px;
	line-height: 1.58;
	margin: 0 0 14px;
}

.med-card-snippet mark,
.med-card-snippet .ep-highlight {
	background: #fff1bd;
	border-radius: 3px;
	color: inherit;
	padding: 0 2px;
}

.med-card-actions {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: space-between;
	margin-top: 12px;
}

.med-state {
	padding: 28px;
	text-align: center;
}

.med-state h3 {
	color: var(--med-color-text);
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 8px;
}

.med-state p {
	color: var(--med-color-muted);
	font-size: 15px;
	line-height: 1.5;
	margin: 0;
}

.med-access-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-bottom: 18px;
}

.med-access-card {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	padding: 16px;
}

.med-access-card p {
	color: #334347;
	font-size: 14px;
	line-height: 1.55;
	margin: 0 0 12px;
}

.med-limit-meter {
	background: #edf5f5;
	border-radius: 999px;
	height: 8px;
	overflow: hidden;
	width: 100%;
}

.med-limit-meter span {
	background: var(--med-color-primary);
	display: block;
	height: 100%;
}

.med-pagination {
	margin-top: 18px;
}

.med-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.med-pagination a,
.med-pagination span {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	display: inline-flex;
	font-weight: 800;
	min-height: 38px;
	min-width: 38px;
	justify-content: center;
	padding: 8px 12px;
	text-decoration: none;
}

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

body.page-template-page-articles .page-header {
	display: none;
}

@media (max-width: 1199px) {
	.med-app-header__inner {
		grid-template-columns: auto minmax(220px, 1fr) auto;
	}

	.med-app-header__nav {
		display: none;
	}

	.med-app-header__mobile-toggle {
		align-items: center;
		background: var(--med-color-surface);
		border: 1px solid var(--med-color-border);
		border-radius: var(--med-radius-md);
		display: inline-flex;
		height: 42px;
		justify-content: center;
		width: 42px;
	}
}

@media (max-width: 900px) {
	body {
		padding-bottom: 70px;
	}

	.med-mobile-nav {
		display: grid;
	}

	.med-app-header__inner {
		gap: 10px;
		grid-template-columns: auto minmax(0, 1fr) auto;
		min-height: 62px;
	}

	.med-app-header__actions .button-register,
	.med-app-header__actions .button-auth i,
	.med-app-header__access.med-badge--full {
		display: none;
	}

	.med-search-box {
		grid-template-columns: auto minmax(0, 1fr);
		min-height: 42px;
		padding: 4px 10px;
	}

	.med-search-box .med-button {
		display: none;
	}

	.med-page-hero {
		padding: 24px 0 18px;
	}

	.med-page-hero__head {
		display: block;
	}

	.med-page-hero__title {
		font-size: 27px;
	}

	.med-page-hero__subtitle {
		font-size: 15px;
	}

	.med-scope-tabs {
		flex-wrap: nowrap;
		margin-left: -15px;
		margin-right: -15px;
		overflow-x: auto;
		padding: 0 15px 4px;
	}

	.med-layout {
		display: block;
		padding-top: 16px;
	}

	.med-filter-panel {
		margin-bottom: 14px;
		position: static;
	}

	.med-filter-panel__nav {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		padding-bottom: 2px;
	}

	.med-filter-panel__link {
		flex: 0 0 auto;
		min-width: 154px;
	}

	.med-results__head {
		align-items: flex-start;
		display: block;
	}

	.med-results__count {
		margin-top: 4px;
	}

	.med-access-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 520px) {
	.med-app-header__brand img {
		max-height: 34px;
	}

	.med-app-header__actions .button-auth {
		font-size: 0;
		min-width: 42px;
		padding: 0;
	}

	.med-app-header__actions .button-auth i {
		display: inline-block;
		font-size: 15px;
	}

	.med-card-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.med-card-actions .med-button {
		width: 100%;
	}
}

/* Articles catalog refinements */
.articles-catalog-search.med-search-box {
	align-items: center;
	background: #f8fbff;
	border: 1px solid #dce6f1;
	border-radius: 8px;
	display: grid;
	gap: 12px;
	grid-template-columns: minmax(230px, 390px) minmax(0, 1fr) 124px;
	margin-bottom: 20px;
	min-height: 64px;
	padding: 10px 12px;
}

.articles-catalog-search__scope.med-search-box__scope,
.articles-catalog-search__field.med-search-box__field {
	background: #ffffff;
	border: 1px solid #dbe4ee;
	border-radius: 8px;
	min-height: 48px;
	padding: 0 18px;
}

.articles-catalog-search__scope.med-search-box__scope:focus-within,
.articles-catalog-search__field.med-search-box__field:focus-within {
	border-color: var(--med-color-primary);
	box-shadow: var(--med-focus);
}

.articles-catalog-search__scope select:focus-visible,
.articles-catalog-search__field input:focus-visible {
	box-shadow: none;
	outline: none !important;
}

.articles-catalog-search__scope.med-search-box__scope {
	border-right: 1px solid #dbe4ee;
	justify-content: center;
}

.articles-catalog-search__scope select {
	width: 100%;
}

.articles-catalog-search__field .ep-autosuggest-container {
	flex: 1;
	min-width: 0;
	position: relative;
	width: 100%;
}

.articles-catalog-search__field .ep-autosuggest-container input {
	height: 40px;
	width: 100%;
}

.articles-catalog-search__field .ep-autosuggest {
	left: 0;
	position: absolute;
	right: 0;
	top: calc(100% + 10px);
	z-index: 2000;
}

.articles-catalog-search__field .ep-autosuggest > ul {
	background: #ffffff;
	border: 1px solid #cfd8e3;
	box-shadow: 0 12px 32px rgba(23, 32, 51, 0.16);
	list-style: none;
	margin: 0;
	max-height: min(52vh, 520px);
	overflow-y: auto;
	padding: 0;
}

.articles-catalog-search .autosuggest-item {
	border-bottom: 1px solid #edf2f7;
	font-size: 16px;
	line-height: 1.45;
	list-style: none;
}

.articles-catalog-search .autosuggest-item:last-child {
	border-bottom: 0;
}

.articles-catalog-search .autosuggest-link {
	color: #172033;
	display: block;
	padding: 8px 14px;
	text-decoration: none;
}

.articles-catalog-search .autosuggest-link:hover,
.articles-catalog-search .autosuggest-item.selected .autosuggest-link {
	background: #f3f8ff;
	color: #0f5fbf;
}

.articles-catalog-search .autosuggest-item_title {
	font-weight: 700;
	margin-bottom: 2px;
}

.articles-catalog-search .autosuggest-item_text {
	color: #303b4d;
	font-size: 15px;
	font-weight: 400;
}

.articles-catalog-search .articles-suggest-status {
	align-items: center;
	color: var(--med-color-muted);
	display: flex;
	font-size: 15px;
	gap: 10px;
	list-style: none;
	min-height: 54px;
	padding: 12px 14px;
}

.articles-catalog-search .articles-suggest-status__spinner {
	animation: articles-suggest-spin .8s linear infinite;
	border: 2px solid #d8e2ec;
	border-radius: 50%;
	border-top-color: var(--med-color-primary);
	height: 18px;
	width: 18px;
}

.articles-catalog-search .articles-suggest-status strong,
.articles-catalog-search .articles-suggest-status small {
	display: block;
}

.articles-catalog-search .articles-suggest-status strong {
	color: var(--med-color-text);
	font-size: 15px;
}

.articles-catalog-search .articles-suggest-status small {
	font-size: 13px;
	margin-top: 2px;
}

@keyframes articles-suggest-spin {
	to { transform: rotate(360deg); }
}

.articles-catalog-search .ep-highlight,
.articles-catalog-search .ep-autosuggest-highlight {
	background: #fff6a6;
	color: inherit;
	padding: 0 1px;
}

@media (prefers-reduced-motion: reduce) {
	.articles-catalog-search .articles-suggest-status__spinner {
		animation-duration: 1.8s;
	}
}

.articles-catalog-search__submit.med-button {
	background: #1769d1;
	border-color: #1769d1;
	color: #ffffff;
	display: inline-flex;
	min-height: 48px;
}

.articles-catalog-search__submit.med-button:hover {
	background: #105bb9;
	border-color: #105bb9;
	color: #ffffff;
}

.articles-catalog-tabs.med-scope-tabs {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: 20px;
	max-width: 1020px;
}

.articles-catalog-tab.med-chip {
	align-items: stretch;
	border-radius: 8px;
	display: block;
	font-size: inherit;
	min-height: 0;
	padding: 18px 20px;
	white-space: normal;
}

.articles-catalog-tab.med-chip:hover,
.articles-catalog-tab.med-chip.is-active {
	background: #ffffff;
	border-color: #1769d1;
	color: #172033;
}

@media (max-width: 900px) {
	.articles-catalog-search.med-search-box,
	.articles-catalog-tabs.med-scope-tabs {
		grid-template-columns: 1fr;
	}

	.articles-catalog-search__submit.med-button {
		display: inline-flex;
		width: 100%;
	}
}

/* Global search results page (/quick-search/, search.php) */
.med-search-page__content {
	padding-top: 24px;
}

.med-search-page .med-page-hero__eyebrow,
.med-directory-page .med-page-hero__eyebrow {
	color: var(--med-color-primary-strong);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.med-search-page .med-search.med-search-box {
	margin-bottom: 4px;
}

/* Keep the EP autosuggest input filling the field after EP wraps it. */
.med-search-page .med-search-box__field,
.med-search-page .med-search-box__field .ep-autosuggest-container {
	flex: 1;
	min-width: 0;
	position: relative;
	width: 100%;
}

.med-search-page .med-search-box__field .ep-autosuggest-container input,
.med-search-page .med-search-box__field input[type="search"] {
	width: 100%;
}

.med-search-page .ep-autosuggest {
	left: 0;
	position: absolute;
	right: 0;
	top: calc(100% + 12px);
	z-index: 2000;
}

.med-search-page .ep-autosuggest > ul {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	box-shadow: var(--med-shadow-soft);
	list-style: none;
	margin: 0;
	max-height: min(52vh, 520px);
	overflow-y: auto;
	padding: 4px;
}

.med-search-page .autosuggest-item {
	list-style: none;
}

.med-search-page .autosuggest-link {
	border-radius: var(--med-radius-sm);
	color: var(--med-color-text);
	display: block;
	font-size: 15px;
	line-height: 1.45;
	padding: 9px 12px;
	text-decoration: none;
}

.med-search-page .autosuggest-link:hover,
.med-search-page .autosuggest-item.selected .autosuggest-link {
	background: var(--med-color-surface-muted);
	color: var(--med-color-primary-strong);
}

.med-search-page .ep-highlight,
.med-search-page .ep-autosuggest-highlight {
	background: #fff1bd;
	color: inherit;
	padding: 0 2px;
}

/* "Did you mean" / EP suggestions block above results. */
.med-search-suggestions {
	color: var(--med-color-muted);
	font-size: 15px;
	margin-bottom: 16px;
}

.med-search-suggestions a {
	color: var(--med-color-primary-strong);
	font-weight: 700;
}

/* Restyle the legacy pagination partial to match the modern paginator. */
.med-search-page .med-pagination .navigation,
.med-search-page .med-pagination .pagination {
	margin: 0;
}

.med-search-page .med-pagination .pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.med-search-page .med-pagination .pagination a,
.med-search-page .med-pagination .pagination span {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	display: inline-flex;
	font-weight: 800;
	justify-content: center;
	min-height: 38px;
	min-width: 38px;
	padding: 8px 12px;
	text-decoration: none;
}

.med-search-page .med-pagination .pagination .current,
.med-search-page .med-pagination .pagination a:hover {
	background: var(--med-color-primary);
	border-color: var(--med-color-primary);
	color: #fff;
}

@media (max-width: 900px) {
	/* Keep the submit button visible on the search page (mobile). */
	.med-search-page .med-search.med-search-box {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}

	.med-search-page .med-search.med-search-box .med-button.med-search__submit {
		display: inline-flex;
		min-height: 38px;
		padding: 8px 14px;
	}
}

/*
 * Hide the legacy page-title bar on modern search surfaces (header.php renders it everywhere);
 * gated to the search body class and the /quick-search/ landing slug.
 */
body.search .page-header,
body.class-name-page-quick-search .page-header,
body.page-template-specialty .page-header,
body.page-template-drug-classes .page-header,
body.tax-specialty .page-header,
body.tax-drug-classes .page-header,
body.single-disease .page-header,
body.single-substance .page-header {
	display: none;
}

/* /quick-search/ landing */
.med-page-hero--center {
	padding: 48px 0 40px;
	text-align: center;
}

.med-page-hero--center .med-page-hero__subtitle {
	margin-left: auto;
	margin-right: auto;
}

.med-search-landing .med-search.med-search-box {
	margin: 22px auto 0;
	max-width: 720px;
}

.med-search-landing__hint {
	color: var(--med-color-muted);
	font-size: 14px;
	margin: 14px 0 0;
}

.med-search-landing__hint a {
	color: var(--med-color-primary-strong);
	font-weight: 700;
	text-decoration: none;
}

.med-search-landing__hint a:hover {
	text-decoration: underline;
}

.med-search-landing__sections {
	padding-top: 32px;
}

.med-section-title {
	color: var(--med-color-text);
	font-size: 20px;
	font-weight: 800;
	margin: 0 0 14px;
}

.med-tile-grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.med-tile {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	display: flex;
	gap: 14px;
	padding: 18px;
	text-decoration: none;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.med-tile:hover {
	border-color: rgba(8, 125, 143, 0.45);
	box-shadow: var(--med-shadow-soft);
	transform: translateY(-1px);
}

.med-tile__icon {
	align-items: center;
	background: var(--med-color-surface-muted);
	border-radius: var(--med-radius-md);
	color: var(--med-color-primary-strong);
	display: inline-flex;
	flex: 0 0 auto;
	font-size: 18px;
	height: 46px;
	justify-content: center;
	width: 46px;
}

.med-tile__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.med-tile__title {
	font-size: 16px;
	font-weight: 800;
}

.med-tile__text {
	color: var(--med-color-muted);
	font-size: 13px;
	line-height: 1.45;
}

.med-tile__chevron {
	color: var(--med-color-muted);
	flex: 0 0 auto;
	margin-left: auto;
}

.med-tile:hover .med-tile__chevron {
	color: var(--med-color-primary-strong);
}

@media (max-width: 720px) {
	.med-page-hero--center {
		padding: 32px 0 26px;
	}

	.med-tile-grid {
		grid-template-columns: 1fr;
	}
}

/*
 * Directory surfaces (/specialty/, /drug-classes/, taxonomy archives), scoped under
 * .med-directory-page. Never style bare ul/li here: the drug-classes fancytree uses them.
 */
.med-directory-page__content {
	padding-top: 24px;
}

.med-directory-page .med-prose {
	color: #3c4b4f;
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 18px;
}

.med-directory-page .med-prose:empty {
	display: none;
	margin: 0;
}

.med-directory-page .med-prose a {
	color: var(--med-color-primary-strong);
	font-weight: 700;
}

.med-directory-page .med-note {
	background: var(--med-color-surface-muted);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: #3c4b4f;
	font-size: 14px;
	line-height: 1.55;
	margin: 0 0 20px;
	padding: 13px 16px;
}

.med-directory-page .med-note a {
	color: var(--med-color-primary-strong);
	font-weight: 700;
}

/* Term card grid (restyle of legacy .category-container / .category-item) */
.med-directory-page .category-container {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	margin: 0 0 24px;
	padding: 0;
}

.med-directory-page .category-container > a {
	text-decoration: none;
}

.med-directory-page .category-item {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	display: flex;
	flex-direction: column;
	gap: 12px;
	height: 100%;
	justify-content: flex-start;
	margin: 0;
	padding: 20px 16px;
	text-align: center;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.med-directory-page .category-container > a:hover .category-item {
	border-color: rgba(8, 125, 143, 0.45);
	box-shadow: var(--med-shadow-soft);
	transform: translateY(-1px);
}

.med-directory-page .category-item img {
	height: 56px;
	object-fit: contain;
	width: 56px;
}

.med-directory-page .category-item h4 {
	color: var(--med-color-text);
	font-size: 15px;
	font-weight: 800;
	line-height: 1.3;
	margin: 0;
}

/* Tree shortcode panel (fancytree wrapper only — internals untouched) */
.med-directory-page .med-tree-panel {
	margin-bottom: 22px;
	overflow: auto;
	padding: 16px;
}

/* Filterable <details> accordions on the specialty archive */
.med-directory-page .med-accordion {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	margin-bottom: 14px;
	overflow: hidden;
}

.med-directory-page .med-accordion__summary {
	color: var(--med-color-text);
	cursor: pointer;
	font-size: 16px;
	font-weight: 800;
	list-style: none;
	padding: 16px 18px;
	position: relative;
	user-select: none;
}

.med-directory-page .med-accordion__summary::-webkit-details-marker {
	display: none;
}

.med-directory-page .med-accordion__summary::after {
	color: var(--med-color-muted);
	content: "+";
	font-size: 20px;
	font-weight: 700;
	position: absolute;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
}

.med-directory-page .med-accordion[open] .med-accordion__summary {
	border-bottom: 1px solid var(--med-color-border);
}

.med-directory-page .med-accordion[open] .med-accordion__summary::after {
	content: "\2013";
}

.med-directory-page .med-accordion__body {
	padding: 16px 18px 18px;
}

/* Filter row (age chips + sort) */
.med-directory-page .med-filter-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	margin: 0 0 14px;
}

.med-directory-page .med-filter-row__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.med-directory-page .med-filter-row__chips .med-chip {
	cursor: pointer;
}

.med-directory-page .med-filter-row__chips .med-chip input {
	accent-color: var(--med-color-primary);
	margin-right: 4px;
}

.med-directory-page .med-filter-row__sort {
	align-items: center;
	color: var(--med-color-muted);
	display: inline-flex;
	font-size: 14px;
	font-weight: 700;
	gap: 8px;
}

.med-directory-page .med-filter-row__sort select {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	font-weight: 700;
	min-height: 38px;
	padding: 6px 10px;
}

/* Link lists (article / disease lists) */
.med-directory-page .med-link-list {
	column-gap: 24px;
	columns: 2;
	list-style: none;
	margin: 0;
	padding: 0;
}

.med-directory-page .med-link-list li {
	break-inside: avoid;
	margin: 0 0 2px;
}

.med-directory-page .med-link-list a {
	border-radius: var(--med-radius-sm);
	color: var(--med-color-text);
	display: block;
	font-size: 15px;
	line-height: 1.4;
	padding: 7px 10px;
	text-decoration: none;
}

.med-directory-page .med-link-list a:hover {
	background: var(--med-color-surface-muted);
	color: var(--med-color-primary-strong);
}

@media (max-width: 720px) {
	.med-directory-page .category-container {
		gap: 10px;
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}

	.med-directory-page .med-filter-row {
		align-items: stretch;
		flex-direction: column;
	}

	.med-directory-page .med-link-list {
		columns: 1;
	}
}

/* Страницы чтения. Вьюер ОХЛП исключён из правил через
   :not(:has(.medvise-ohlp-viewer)) — иначе ломается его вёрстка. */
body.single-disease #main-content,
body.single-substance #main-content:not(:has(.medvise-ohlp-viewer)) {
	background: var(--med-color-bg);
}

/* White reading card (skipped on OHLП substance pages). */
body.single-disease .post-wrap:not(:has(.medvise-ohlp-viewer)),
body.single-substance .post-wrap:not(:has(.medvise-ohlp-viewer)) {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-lg);
	margin: 28px auto;
	max-width: 880px;
	padding: 30px 36px 36px;
}

body.single-disease .post-wrap:not(:has(.medvise-ohlp-viewer)) > .entry-title,
body.single-substance .post-wrap:not(:has(.medvise-ohlp-viewer)) > .entry-title {
	color: var(--med-color-text);
	font-size: 30px;
	font-weight: 800;
	line-height: 1.18;
	margin: 6px 0 18px;
}

/* Reading typography (guarded against the OHLП viewer). */
body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)),
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) {
	color: #2c3a3d;
	font-size: 16px;
	line-height: 1.72;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) h2,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) h2,
body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) h3,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) h3,
body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) h4,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) h4 {
	color: var(--med-color-text);
	font-weight: 800;
	line-height: 1.3;
	margin: 1.5em 0 0.5em;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) h2,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) h2 {
	font-size: 22px;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) h3,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) h3 {
	font-size: 19px;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) a,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) a {
	color: var(--med-color-primary-strong);
	text-decoration: underline;
	text-underline-offset: 2px;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) img,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) img {
	border-radius: var(--med-radius-md);
	height: auto;
	max-width: 100%;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) blockquote,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) blockquote {
	border-left: 3px solid var(--med-color-primary);
	color: #3c4b4f;
	margin: 1.2em 0;
	padding: 4px 0 4px 16px;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) table,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) table {
	border-collapse: collapse;
	width: 100%;
}

body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) td,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) td,
body.single-disease .entry-content:not(:has(.medvise-ohlp-viewer)) th,
body.single-substance .entry-content:not(:has(.medvise-ohlp-viewer)) th {
	border: 1px solid var(--med-color-border);
	padding: 9px 12px;
	text-align: left;
}

/* Meta row */
body.single-disease .post-wrap:not(:has(.medvise-ohlp-viewer)) .item-meta,
body.single-substance .post-wrap:not(:has(.medvise-ohlp-viewer)) .item-meta {
	color: var(--med-color-muted);
	font-size: 13px;
	font-weight: 700;
}

/* Article-files list */
body.single-disease .entry-files,
body.single-substance .entry-files:not(:has(.medvise-ohlp-viewer)) {
	background: var(--med-color-surface-muted);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	list-style: none;
	margin: 22px 0;
	padding: 14px 16px;
}

body.single-disease .entry-files li,
body.single-substance .entry-files li {
	margin: 4px 0;
}

body.single-disease .entry-files a,
body.single-substance .entry-files a {
	color: var(--med-color-primary-strong);
	font-weight: 700;
}

/* Authors / editors block */
body.single-disease .author-post,
body.single-substance .author-post:not(:has(.medvise-ohlp-viewer)) {
	background: var(--med-color-surface-muted);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	margin: 22px 0;
	padding: 18px 20px;
}

body.single-disease .author-post__type,
body.single-substance .author-post__type {
	color: var(--med-color-muted);
	font-size: 13px;
	font-weight: 800;
	margin-bottom: 4px;
	text-transform: uppercase;
}

body.single-disease .author-post a,
body.single-substance .author-post a {
	color: var(--med-color-primary-strong);
	font-weight: 700;
}

/* No-access / subscribe paywall card */
body.single-disease .subscribe-access,
body.single-substance .subscribe-access {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-lg);
	padding: 24px;
}

/* Share button */
body.single-disease .share-article__wrapper,
body.single-substance .share-article__wrapper {
	margin: 0 0 6px;
}

body.single-disease .podelitsya-article.button,
body.single-substance .podelitsya-article.button {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	display: inline-flex;
	font-weight: 700;
	gap: 8px;
	min-height: 40px;
	padding: 9px 14px;
	text-decoration: none;
}

body.single-disease .podelitsya-article.button:hover,
body.single-substance .podelitsya-article.button:hover {
	border-color: var(--med-color-primary);
	color: var(--med-color-primary-strong);
}

/* Related posts */
body.single-disease .related-post .box-title,
body.single-substance .related-post .box-title {
	color: var(--med-color-text);
	font-size: 22px;
	font-weight: 800;
	margin: 18px 0 14px;
}

body.single-disease .related-post .entry-border,
body.single-substance .related-post .entry-border {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	overflow: hidden;
}

body.single-disease .related-post .content-post,
body.single-substance .related-post .content-post {
	padding: 14px 16px;
}

body.single-disease .related-post .content-post .entry-title,
body.single-substance .related-post .content-post .entry-title {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.3;
	margin: 4px 0 0;
}

body.single-disease .related-post .content-post .entry-title a,
body.single-substance .related-post .content-post .entry-title a {
	color: var(--med-color-text);
	text-decoration: none;
}

@media (max-width: 720px) {
	body.single-disease .post-wrap:not(:has(.medvise-ohlp-viewer)),
	body.single-substance .post-wrap:not(:has(.medvise-ohlp-viewer)) {
		margin: 16px auto;
		padding: 20px 18px 24px;
	}

	body.single-disease .post-wrap:not(:has(.medvise-ohlp-viewer)) > .entry-title,
	body.single-substance .post-wrap:not(:has(.medvise-ohlp-viewer)) > .entry-title {
		font-size: 25px;
	}
}

/* Страницы WooCommerce. Всё привязано к #main-content: шапка и подвал
   используют те же классы кнопок, их задевать нельзя. */
body.class-name-page-subscribe #main-content,
body.woocommerce-account #main-content,
body.woocommerce-cart #main-content,
body.woocommerce-checkout #main-content {
	background: var(--med-color-bg);
}

/* Unified buttons */
body.class-name-page-subscribe #main-content .themesflat-button,
body.class-name-page-subscribe #main-content .button,
body.class-name-page-subscribe #main-content .add_to_cart_button,
body.woocommerce-account #main-content .themesflat-button,
body.woocommerce-account #main-content .button,
body.woocommerce-cart #main-content .themesflat-button,
body.woocommerce-cart #main-content .button,
body.woocommerce-checkout #main-content .themesflat-button,
body.woocommerce-checkout #main-content .button {
	border-radius: var(--med-radius-md);
	font-weight: 700;
}

body.class-name-page-subscribe #main-content .button.add_to_cart_button,
body.woocommerce-cart #main-content .checkout-button,
body.woocommerce-cart #main-content .wc-proceed-to-checkout .button,
body.woocommerce-checkout #main-content #place_order {
	background: var(--med-color-primary);
	border: 1px solid var(--med-color-primary);
	color: #fff;
}

body.class-name-page-subscribe #main-content .button.add_to_cart_button:hover,
body.woocommerce-cart #main-content .checkout-button:hover,
body.woocommerce-checkout #main-content #place_order:hover {
	background: var(--med-color-primary-strong);
	border-color: var(--med-color-primary-strong);
	color: #fff;
}

/* Inputs (no width changes) */
body.class-name-page-subscribe #main-content .input-text,
body.woocommerce-account #main-content .input-text,
body.woocommerce-account #main-content input[type="text"],
body.woocommerce-account #main-content input[type="email"],
body.woocommerce-account #main-content input[type="password"],
body.woocommerce-cart #main-content .input-text,
body.woocommerce-checkout #main-content .input-text {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	min-height: 44px;
	padding: 10px 12px;
}

body.class-name-page-subscribe #main-content .input-text:focus,
body.woocommerce-account #main-content .input-text:focus,
body.woocommerce-cart #main-content .input-text:focus,
body.woocommerce-checkout #main-content .input-text:focus {
	border-color: var(--med-color-primary);
	box-shadow: var(--med-focus);
	outline: none;
}

/* /subscribe/ tariff cards */
body.class-name-page-subscribe #main-content .sub-tariffs__cards {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

body.class-name-page-subscribe #main-content .sub-tariff__card {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-lg);
	box-shadow: var(--med-shadow-soft);
	display: flex;
	flex-direction: column;
	padding: 22px 22px 20px;
}

body.class-name-page-subscribe #main-content .sub-tariff__title {
	align-items: baseline;
	border-bottom: 1px solid var(--med-color-border);
	display: flex;
	gap: 10px;
	justify-content: space-between;
	margin-bottom: 14px;
	padding-bottom: 12px;
}

body.class-name-page-subscribe #main-content .sub-tariff__title_left {
	color: var(--med-color-text);
	font-size: 18px;
	font-weight: 800;
}

body.class-name-page-subscribe #main-content .sub-tariff__title_right {
	color: var(--med-color-primary-strong);
	font-weight: 800;
}

body.class-name-page-subscribe #main-content .sub-tariff__point {
	color: var(--med-color-muted);
	font-size: 13px;
	font-weight: 700;
	margin-top: 8px;
	text-transform: uppercase;
}

body.class-name-page-subscribe #main-content .sub-tariff__card__bottom {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: auto;
	padding-top: 16px;
}

body.class-name-page-subscribe #main-content .sub-tariff__link {
	background: transparent;
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	color: var(--med-color-text);
	cursor: pointer;
	font-weight: 700;
	padding: 9px 14px;
}

body.class-name-page-subscribe #main-content .woocommerce-Price-amount {
	color: var(--med-color-text);
	font-weight: 800;
}

/* /my-account/ login form + dashboard */
body.woocommerce-account #main-content .login-form {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-lg);
	box-shadow: var(--med-shadow-soft);
	margin: 0 auto;
	max-width: 480px;
	padding: 28px;
}

body.woocommerce-account #main-content .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

body.woocommerce-account #main-content .woocommerce-MyAccount-navigation li {
	border-radius: var(--med-radius-md);
	margin-bottom: 4px;
}

body.woocommerce-account #main-content .woocommerce-MyAccount-navigation li.is-active,
body.woocommerce-account #main-content .woocommerce-MyAccount-navigation li:hover {
	background: var(--med-color-surface-muted);
}

body.woocommerce-account #main-content .woocommerce-MyAccount-navigation li a {
	color: var(--med-color-text);
	display: block;
	font-weight: 700;
	padding: 9px 12px;
	text-decoration: none;
}

body.woocommerce-account #main-content .woocommerce-MyAccount-content {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	padding: 22px;
}

/* /cart/ + /checkout/ tables and panels */
body.woocommerce-cart #main-content .shop_table,
body.woocommerce-checkout #main-content .shop_table {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	width: 100%;
}

body.woocommerce-cart #main-content .shop_table th,
body.woocommerce-checkout #main-content .shop_table th {
	background: var(--med-color-surface-muted);
	color: var(--med-color-text);
	font-weight: 800;
	padding: 12px 14px;
	text-align: left;
}

body.woocommerce-cart #main-content .shop_table td,
body.woocommerce-checkout #main-content .shop_table td {
	border-top: 1px solid var(--med-color-border);
	padding: 12px 14px;
}

body.woocommerce-cart #main-content .cart_totals,
body.woocommerce-checkout #main-content .woocommerce-checkout-review-order,
body.woocommerce-checkout #main-content .woocommerce-checkout-payment {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	padding: 18px 20px;
}

body.woocommerce-checkout #main-content .wc_payment_methods {
	list-style: none;
	margin: 0;
	padding: 0;
}

body.woocommerce-checkout #main-content .wc_payment_methods li {
	border-top: 1px solid var(--med-color-border);
	padding: 12px 4px;
}

body.woocommerce-checkout #main-content .wc_payment_methods li:first-child {
	border-top: 0;
}

@media (max-width: 720px) {
	body.woocommerce-account #main-content .login-form {
		padding: 20px;
	}

	body.class-name-page-subscribe #main-content .sub-tariffs__cards {
		grid-template-columns: 1fr;
	}
}

/* Палитра, фон и типографика. Действует только там, где подключён
   этот файл, — список страниц задаёт inc/modern-ui.php. */

/* Full-bleed page background: paint html + body, drop the boxed width cap and clear wrapper
 * backgrounds so the page colour runs edge to edge without a seam. */
html,
body {
	background: var(--med-color-bg) !important;
}

.themesflat-boxed {
	background: transparent !important;
	box-shadow: none !important;
	max-width: none !important;
	width: auto !important;
}

#main-content,
#main-content.site-main,
#themesflat-content,
#themesflat-content.page-wrap,
.wrap-content-area,
#primary.content-area,
main.main-content {
	background: transparent !important;
}

/* Fluid container: fills laptops/tablets, caps for readability, classy on 4K. */
body .container {
	max-width: min(1480px, 94vw);
	width: 100%;
}

@media (min-width: 2200px) {
	body .container {
		max-width: 1680px;
	}
}

/* Smaller logo + cleaner header (header markup unchanged). */
#header.header {
	border-bottom: 1px solid var(--med-color-border);
}

#header .inner-header {
	padding-top: 6px;
	padding-bottom: 6px;
}

#header #logo .site-logo,
#header #logo img {
	max-height: 40px;
	width: auto;
}

#header #mainnav > ul > li > a {
	border-radius: var(--med-radius-md);
	font-weight: 700;
	transition: background-color 0.16s ease, color 0.16s ease;
}

#header #mainnav > ul > li > a:hover,
#header #mainnav > ul > li.current-menu-item > a,
#header #mainnav > ul > li.current_page_item > a {
	color: var(--med-color-primary-strong);
}

/* Uniform specialty / drug-class term cards (equal width AND height). */
.med-directory-page .category-container {
	align-items: stretch;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.med-directory-page .category-container > a {
	display: block;
	height: 100%;
	width: 100%;
}

.med-directory-page .category-item {
	box-sizing: border-box;
	height: 100%;
	justify-content: center;
	min-height: 170px;
	width: 100%;
}

.med-directory-page .category-item img {
	height: 60px;
	object-fit: contain;
	width: 60px;
}

/* Каталог опросников в общем стиле. */

/* Офф-канвас мобильного меню даёт горизонтальный сдвиг на узких экранах
 * и открывает справа непрокрашенную полосу. Обрезаем, не ломая sticky. */
html,
body {
	overflow-x: clip;
}

/* /vse-oprosniki/ — quiz catalog page (legacy .search-form + fancytree). */
body.class-name-page-vse-oprosniki .search-form__main {
	align-items: center;
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	gap: 8px;
	padding: 4px 4px 4px 14px;
}

body.class-name-page-vse-oprosniki .search-form__main label {
	flex: 1;
	min-width: 0;
}

body.class-name-page-vse-oprosniki .search-form input.s {
	background: transparent;
	border: 0;
	color: var(--med-color-text);
	font-size: 15px;
	min-height: 40px;
	width: 100%;
}

body.class-name-page-vse-oprosniki .search-submit {
	background: var(--med-color-primary);
	border: 0;
	border-radius: var(--med-radius-md);
	color: #fff;
	min-height: 42px;
	min-width: 48px;
}

body.class-name-page-vse-oprosniki .search-submit:hover {
	background: var(--med-color-primary-strong);
}

body.class-name-page-vse-oprosniki .fancytree-container_search {
	background: var(--med-color-surface);
	border: 1px solid var(--med-color-border);
	border-radius: var(--med-radius-md);
	padding: 12px 14px;
}

/* Recolour the catalog accent (cyan → brand blue) within the quiz catalog. */
body.class-name-page-vse-oprosniki .fancytree-container_search a {
	color: var(--med-color-primary-strong);
}

/* Быстрый поиск по статьям в палитре справочника препаратов. */
.med-quick-search-page {
	--med-quick-ink: #091d3e;
	--med-quick-action: #0b819f;
	--med-quick-action-strong: #08677f;
	--med-quick-muted: #52647d;
	--med-quick-border: #dbe5ef;
	--med-quick-bg: #f2f6fa;
	background: var(--med-quick-bg);
	color: var(--med-quick-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	min-height: 60vh;
}

.med-quick-hero {
	background: #edf5fa;
	border-bottom: 1px solid #dce8ef;
	padding: 46px 0 38px;
}

.med-quick-hero__inner {
	max-width: 1040px !important;
}

.med-quick-hero__copy {
	margin: 0 auto 24px;
	max-width: 820px;
	text-align: center;
}

.med-source-note {
	align-items: center;
	background: #fff;
	border: 1px solid var(--med-quick-border);
	border-radius: 999px;
	box-shadow: 0 5px 16px rgba(9, 29, 62, 0.08);
	color: #455a75;
	display: inline-flex;
	font-size: 13px;
	font-weight: 700;
	gap: 8px;
	line-height: 1.2;
	margin-bottom: 18px;
	padding: 7px 12px;
}

.med-source-note > span {
	background: #20a987;
	border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(32, 169, 135, 0.12);
	display: block;
	height: 7px;
	width: 7px;
}

.med-quick-hero h1 {
	color: var(--med-quick-ink);
	font-size: 42px;
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.12;
	margin: 0 0 10px;
	text-wrap: balance;
}

.med-quick-hero__copy > p,
.med-results-heading p {
	color: var(--med-quick-muted);
	font-size: 17px;
	line-height: 1.55;
	margin: 0;
	text-wrap: pretty;
}

.med-quick-search-form {
	margin: 0 auto;
	max-width: 860px;
}

.med-quick-search-form__bar {
	align-items: center;
	background: #fff;
	border: 1px solid #aacbe0;
	border-radius: 15px;
	box-shadow: 0 12px 28px rgba(9, 29, 62, 0.13);
	display: grid;
	gap: 12px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	min-height: 68px;
	padding: 6px 7px 6px 20px;
}

.med-quick-search-form__icon {
	color: #7189a5;
	display: inline-flex;
	font-size: 18px;
}

.med-quick-search-form__field {
	min-width: 0;
	position: relative;
}

.med-quick-search-form__field > input {
	background: transparent;
	border: 0;
	box-shadow: none;
	color: var(--med-quick-ink);
	font-size: 17px;
	height: 48px;
	line-height: 1.3;
	min-width: 0;
	outline: 0;
	padding: 0;
	width: 100%;
}

.med-quick-search-form__field > input::placeholder {
	color: #60738d;
	opacity: 1;
}

.med-quick-search-form__field > input:focus-visible {
	box-shadow: none;
}

.med-quick-search-form__bar:focus-within {
	border-color: var(--med-quick-action);
	box-shadow: 0 0 0 3px rgba(11, 129, 159, 0.18), 0 12px 28px rgba(9, 29, 62, 0.13);
}

.med-quick-search-form__submit.med-button {
	background: var(--med-quick-action);
	border-color: var(--med-quick-action);
	border-radius: 12px;
	color: #fff;
	font-size: 15px;
	min-height: 50px;
	min-width: 118px;
}

.med-quick-search-form__submit.med-button:hover,
.med-quick-search-form__submit.med-button:active {
	background: var(--med-quick-action-strong);
	border-color: var(--med-quick-action-strong);
	color: #fff;
}

.med-quick-search-form__scopes {
	align-items: center;
	border: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 20px;
	margin: 15px 0 0;
	min-width: 0;
	padding: 0;
}

.med-quick-search-form__scopes legend {
	color: #344762;
	float: left;
	font-size: 14px;
	font-weight: 800;
	line-height: 26px;
	margin: 0 2px 0 0;
	padding: 0;
	width: auto;
}

.med-scope-check {
	align-items: center;
	color: #263a57;
	cursor: pointer;
	display: inline-flex;
	font-size: 14px;
	font-weight: 700;
	gap: 8px;
	line-height: 1.35;
	margin: 0;
	min-height: 32px;
	position: relative;
}

.med-scope-check input {
	height: 1px;
	left: 5px;
	opacity: 0;
	position: absolute;
	top: 15px;
	width: 1px;
}

.med-scope-check__box {
	align-items: center;
	background: #fff;
	border: 1px solid #9fb3ca;
	border-radius: 5px;
	color: transparent;
	display: inline-flex;
	flex: 0 0 22px;
	font-size: 11px;
	height: 22px;
	justify-content: center;
	transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
	width: 22px;
}

.med-scope-check input:checked + .med-scope-check__box {
	background: var(--med-quick-action);
	border-color: var(--med-quick-action);
	color: #fff;
}

.med-scope-check input:focus-visible + .med-scope-check__box {
	box-shadow: 0 0 0 3px rgba(11, 129, 159, 0.22);
}

.med-form-error {
	color: #9f2f2f;
	font-size: 14px;
	font-weight: 700;
	margin: 8px 0 0;
}

.med-quick-examples {
	align-items: center;
	color: var(--med-quick-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	gap: 7px;
	justify-content: center;
	margin: 16px 0 0;
}

.med-quick-examples a {
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid #d1e0e9;
	border-radius: 999px;
	color: #365170;
	font-weight: 700;
	padding: 5px 9px;
	text-decoration: none;
}

.med-quick-examples a:hover {
	background: #fff;
	border-color: var(--med-quick-action);
	color: var(--med-quick-action-strong);
}

.med-quick-suggest {
	background: #fff;
	border: 1px solid var(--med-quick-border);
	border-radius: 12px;
	box-shadow: 0 18px 38px rgba(9, 29, 62, 0.18);
	left: -42px;
	max-height: min(55vh, 520px);
	overflow-y: auto;
	position: absolute;
	right: -136px;
	top: calc(100% + 13px);
	z-index: 2000;
}

.med-quick-suggest[hidden] {
	display: none;
}

.med-quick-suggest ul {
	list-style: none;
	margin: 0;
	padding: 6px;
}

.med-quick-suggest li {
	list-style: none;
	margin: 0;
}

.med-quick-suggest a {
	align-items: flex-start;
	border-radius: 8px;
	color: var(--med-quick-ink);
	display: flex;
	gap: 12px;
	padding: 11px 12px;
	text-decoration: none;
}

.med-quick-suggest li.is-active a,
.med-quick-suggest a:hover {
	background: #eef6fa;
	color: var(--med-quick-ink);
}

.med-quick-suggest__lang {
	background: #e5f3f7;
	border-radius: 5px;
	color: #096780;
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	margin-top: 2px;
	padding: 5px 6px;
}

.med-quick-suggest__copy {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.med-quick-suggest__copy strong {
	font-size: 14px;
	line-height: 1.4;
}

.med-quick-suggest__copy small {
	color: var(--med-quick-muted);
	display: -webkit-box;
	font-size: 13px;
	line-height: 1.4;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.med-quick-suggest mark {
	background: #fff0a8;
	color: inherit;
	padding: 0 1px;
}

.med-search-access {
	align-items: center;
	background: #fff;
	border: 1px solid var(--med-quick-border);
	border-radius: 15px;
	box-shadow: 0 10px 24px rgba(9, 29, 62, 0.09);
	display: grid;
	gap: 16px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	margin: 0 auto;
	max-width: 860px;
	padding: 18px 20px;
	text-align: left;
}

.med-search-access__icon {
	align-items: center;
	background: #e6f3f7;
	border-radius: 12px;
	color: var(--med-quick-action-strong);
	display: inline-flex;
	font-size: 17px;
	height: 46px;
	justify-content: center;
	width: 46px;
}

.med-search-access h2 {
	color: var(--med-quick-ink);
	font-size: 17px;
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 4px;
}

.med-search-access p {
	color: var(--med-quick-muted);
	font-size: 14px;
	line-height: 1.45;
	margin: 0;
	max-width: 65ch;
}

.med-search-access__actions {
	display: flex;
	gap: 8px;
}

.med-quick-content {
	padding: 32px 0 64px;
}

.med-quick-content > .container {
	max-width: 1040px !important;
}

.med-quick-workspace {
	background: #fff;
	border: 1px solid var(--med-quick-border);
	border-radius: 14px;
	overflow: hidden;
}

.med-quick-workspace__header {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 24px;
	text-align: left;
}

.med-quick-workspace__header h2 {
	color: var(--med-quick-ink);
	font-size: 19px;
	font-weight: 800;
	line-height: 1.3;
	margin: 0;
	text-align: left;
}

.med-quick-workspace__header p {
	color: var(--med-quick-muted);
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
}

.med-tid-demo-row {
	align-items: center;
	background: #fffdf4;
	border-top: 1px solid var(--med-quick-border);
	display: grid;
	gap: 16px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	min-height: 84px;
	padding: 14px 24px;
}

.med-tid-demo-row__mark {
	align-items: center;
	background: #ffdd2d;
	border-radius: 12px;
	color: #2c2c2c;
	display: inline-flex;
	font-size: 19px;
	font-weight: 900;
	height: 48px;
	justify-content: center;
	width: 48px;
}

.med-tid-demo-row__copy {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.med-tid-demo-row__copy strong {
	color: var(--med-quick-ink);
	font-size: 15px;
	line-height: 1.35;
}

.med-tid-demo-row__copy strong > span,
.med-tid-demo-row__status {
	background: #f2f4f7;
	border: 1px solid #d9e0e8;
	border-radius: 999px;
	color: #46566b;
	display: inline-flex;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.03em;
	line-height: 1;
	margin-left: 5px;
	padding: 4px 6px;
	vertical-align: 2px;
}

.med-tid-demo-row__copy small {
	color: var(--med-quick-muted);
	font-size: 13px;
	line-height: 1.45;
}

.med-tid-demo-row__actions {
	align-items: center;
	display: flex;
	gap: 8px;
	margin: 0;
}

.med-tid-demo-button.med-button {
	background: #ffdd2d;
	border-color: #e9c91e;
	color: #242424;
	min-height: 44px;
}

.med-tid-demo-button.med-button:hover,
.med-tid-demo-button.med-button:active {
	background: #f2ca00;
	border-color: #d9b500;
	color: #171717;
}

.med-tid-demo-button.med-button:focus-visible {
	box-shadow: 0 0 0 3px rgba(120, 99, 0, 0.25);
	outline: none;
}

.med-tid-demo-row--consent {
	background: #fff;
}

.med-tid-demo-row--success {
	background: #f1faf5;
}

.med-tid-demo-row--success .med-tid-demo-row__mark {
	background: #d9f2e3;
	color: #23734d;
}

.med-tid-demo-row--error {
	background: #fff6f4;
}

.med-tid-demo-row--error .med-tid-demo-row__mark {
	background: #fce1dc;
	color: #9f3028;
}

.med-quick-links {
	display: flex;
	flex-direction: column;
}

.med-quick-link {
	align-items: center;
	border-top: 1px solid var(--med-quick-border);
	color: var(--med-quick-ink);
	display: grid;
	gap: 16px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	min-height: 80px;
	padding: 12px 24px;
	text-decoration: none;
	transition: color 180ms ease-out, background-color 180ms ease-out;
}

.med-quick-link:hover {
	background: #f7fafc;
	color: var(--med-quick-action-strong);
}

.med-quick-link > i:last-child {
	transition: transform 180ms ease-out;
}

.med-quick-link:hover > i:last-child {
	transform: translateX(4px);
}

.med-quick-link:focus-visible {
	box-shadow: inset 0 0 0 3px rgba(11, 139, 173, 0.26);
	outline: none;
}

.med-quick-link__icon {
	align-items: center;
	background: #e6f3f7;
	border-radius: 12px;
	color: var(--med-quick-action-strong);
	display: inline-flex;
	font-size: 16px;
	font-weight: 800;
	height: 48px;
	justify-content: center;
	width: 48px;
}

.med-quick-link__icon--en {
	background: #e9eef8;
	color: #436393;
	font-size: 12px;
}

.med-quick-link__icon--drug {
	background: #d8eef3;
}

.med-quick-link > span:nth-child(2) {
	display: grid;
	gap: 4px;
}

.med-quick-link strong {
	font-size: 15px;
	line-height: 1.35;
}

.med-quick-link small {
	color: var(--med-quick-muted);
	font-size: 13px;
	line-height: 1.35;
}

.med-quick-link--drug {
	background: #f5fafb;
}

.med-quick-link--drug:hover {
	background: #eaf5f7;
}

.med-quick-hero--results {
	padding: 30px 0 26px;
}

.med-results-heading {
	align-items: flex-end;
	display: flex;
	gap: 20px;
	justify-content: space-between;
	margin-bottom: 20px;
}

.med-results-heading h1 {
	font-size: 32px;
	margin-bottom: 6px;
}

.med-back-link {
	align-items: center;
	color: var(--med-quick-action-strong);
	display: inline-flex;
	font-size: 13px;
	font-weight: 800;
	gap: 7px;
	margin-bottom: 10px;
	text-decoration: none;
}

.med-results-total {
	background: #fff;
	border: 1px solid var(--med-quick-border);
	border-radius: 999px;
	color: #3b526f;
	font-size: 13px;
	font-weight: 800;
	padding: 8px 12px;
	white-space: nowrap;
}

.med-quick-results .container {
	max-width: 1040px !important;
}

.med-quick-search-page .med-result-list {
	gap: 10px;
}

.med-quick-search-page .med-result-card {
	border-radius: 14px;
	box-shadow: none;
	padding: 20px 22px;
}

.med-quick-search-page .med-result-card:hover {
	border-color: #a8c7da;
	box-shadow: 0 8px 22px rgba(9, 29, 62, 0.07);
	transform: none;
}

.med-quick-search-page .med-card-title {
	font-size: 19px;
	margin-bottom: 7px;
}

.med-quick-search-page .med-card-snippet {
	font-size: 14px;
	line-height: 1.55;
	margin-bottom: 10px;
}

.med-result-card__link {
	align-items: center;
	color: var(--med-quick-action-strong);
	display: inline-flex;
	font-size: 14px;
	font-weight: 800;
	gap: 8px;
	text-decoration: none;
}

.med-quick-search-page .med-state {
	border-radius: 14px;
	margin: 10px auto 0;
	max-width: 720px;
}

.med-state__icon {
	align-items: center;
	background: #e6f3f7;
	border-radius: 50%;
	color: var(--med-quick-action-strong);
	display: inline-flex;
	font-size: 18px;
	height: 48px;
	justify-content: center;
	margin-bottom: 12px;
	width: 48px;
}

@media (max-width: 900px) {
	.med-search-access {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.med-search-access__actions {
		grid-column: 1 / -1;
		justify-content: center;
	}
}

@media (max-width: 720px) {
	.med-quick-hero {
		padding: 30px 0 26px;
	}

	.med-quick-hero h1 {
		font-size: 31px;
		letter-spacing: -0.025em;
	}

	.med-quick-hero__copy > p,
	.med-results-heading p {
		font-size: 15px;
	}

	.med-quick-search-form__bar {
		gap: 8px;
		grid-template-columns: auto minmax(0, 1fr);
		padding: 7px 10px 7px 15px;
	}

	.med-quick-search-form__field > input {
		font-size: 16px;
	}

	.med-quick-search-form__submit.med-button {
		display: inline-flex;
		grid-column: 1 / -1;
		min-height: 46px;
		width: 100%;
	}

	.med-quick-search-form__scopes {
		align-items: stretch;
		display: grid;
		gap: 7px;
	}

	.med-quick-search-form__scopes legend {
		float: none;
		margin-bottom: 2px;
	}

	.med-scope-check {
		background: rgba(255, 255, 255, 0.72);
		border: 1px solid #d5e2eb;
		border-radius: 9px;
		min-height: 44px;
		padding: 6px 10px;
	}

	.med-quick-suggest {
		left: -38px;
		right: -10px;
	}

	.med-quick-examples {
		justify-content: flex-start;
	}

	.med-quick-content {
		padding: 24px 0 48px;
	}

	.med-quick-workspace__header {
		padding: 20px 16px;
	}

	.med-tid-demo-row {
		align-items: flex-start;
		gap: 12px;
		grid-template-columns: auto minmax(0, 1fr);
		padding: 14px 16px;
	}

	.med-tid-demo-row__mark {
		height: 44px;
		width: 44px;
	}

	.med-tid-demo-row > .med-button,
	.med-tid-demo-row__actions,
	.med-tid-demo-row__status {
		grid-column: 1 / -1;
	}

	.med-tid-demo-row > .med-button,
	.med-tid-demo-row__actions {
		width: 100%;
	}

	.med-tid-demo-row__actions {
		align-items: stretch;
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.med-tid-demo-row__actions .med-button {
		width: 100%;
	}

	.med-tid-demo-row__status {
		justify-self: start;
		margin-left: 0;
	}

	.med-quick-link {
		gap: 12px;
		min-height: 80px;
		padding: 12px 16px;
	}

	.med-quick-link__icon {
		height: 44px;
		width: 44px;
	}

	.med-search-access {
		display: flex;
		flex-direction: column;
		text-align: center;
	}

	.med-search-access__actions {
		align-items: stretch;
		flex-direction: column;
		width: 100%;
	}

	.med-search-access__actions .med-button {
		width: 100%;
	}

	.med-results-heading {
		align-items: flex-start;
		flex-direction: column;
		gap: 10px;
	}

	.med-results-heading h1 {
		font-size: 27px;
	}

	.med-results-total {
		align-self: flex-start;
	}

	.med-quick-search-page .med-result-card {
		padding: 17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.med-quick-search-page *,
	.med-quick-search-page *::before,
	.med-quick-search-page *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* Карточка статьи: тема даёт article 60px снизу и подчёркивает ссылки рамкой. */
/* Плотная карточка в выдаче статей.
   Скоуп только на статьи: .med-article-card общий с каталогом препаратов. */
.articles-catalog-card.med-article-card {
	margin: 0;
	padding: 13px 14px;
}

.articles-catalog-card .med-card-title {
	font-size: 17px;
	margin: 0 0 6px;
}

.articles-catalog-card .med-card-meta {
	font-size: 12px;
}

.articles-catalog-grid.med-article-list {
	gap: 14px;
}

.articles-catalog-card .med-card-title a {
	border-bottom: 0;
}

.articles-catalog-card .med-card-title a:hover {
	color: var(--med-color-primary-strong);
}

/* Вкладка языка: две строки — название и объём. */
.articles-catalog-tab.med-chip .articles-catalog-tab__title {
	display: block;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.25;
}

.articles-catalog-tab.med-chip strong {
	color: var(--med-color-text);
	display: block;
	font-size: 14px;
	font-weight: 700;
	margin-top: 4px;
}

.articles-catalog-tab.med-chip small {
	color: var(--med-color-muted);
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-top: 2px;
}

.articles-catalog-tab.med-chip.is-active {
	box-shadow: inset 0 0 0 1px #1769d1;
}

/* Ширина страницы статей: тема держит #main-content на 80 %, из-за чего колонка
 * уже шапки и подвала. Сайдбара на этой странице нет — отдаём всю ширину. */
body.page-template-page-articles #main-content {
	margin-left: 0;
	margin-right: 0;
	width: 100%;
}

body.page-template-page-articles .container {
	max-width: 1320px;
}

.articles-catalog-tabs.med-scope-tabs {
	max-width: none;
}

.articles-catalog-layout--without-sidebar {
	grid-template-columns: minmax(0, 1fr);
}

.articles-catalog-sidebar__toggle {
	display: none;
}

@media (max-width: 900px) {
	.articles-catalog-sidebar__panel.is-collapsible {
		overflow: hidden;
		padding: 0;
	}

	.articles-catalog-sidebar__panel.is-collapsible .articles-catalog-sidebar__title {
		display: none;
	}

	.articles-catalog-sidebar__toggle {
		align-items: center;
		appearance: none;
		background: transparent;
		border: 0;
		color: var(--med-color-text);
		cursor: pointer;
		display: grid;
		font: inherit;
		gap: 3px 10px;
		grid-template-columns: minmax(0, 1fr) auto;
		min-height: 52px;
		padding: 8px 14px;
		text-align: left;
		width: 100%;
	}

	.articles-catalog-sidebar__toggle span {
		color: var(--med-color-muted);
		font-size: 12px;
		font-weight: 700;
		grid-column: 1;
		line-height: 1.2;
	}

	.articles-catalog-sidebar__toggle strong {
		font-size: 15px;
		font-weight: 800;
		grid-column: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.articles-catalog-sidebar__toggle i {
		color: var(--med-color-muted);
		font-size: 12px;
		grid-column: 2;
		grid-row: 1 / 3;
		transition: transform .16s ease-out;
	}

	.articles-catalog-sidebar__panel.is-open .articles-catalog-sidebar__toggle i {
		transform: rotate(180deg);
	}

	.articles-catalog-sidebar__toggle:focus-visible {
		box-shadow: inset var(--med-focus);
		outline: none;
	}

	.articles-catalog-sidebar__panel.is-collapsible:not(.is-open) .articles-catalog-sidebar__nav {
		display: none;
	}

	.articles-catalog-sidebar__panel .articles-catalog-sidebar__nav {
		border-top: 1px solid var(--med-color-border);
		display: grid;
		gap: 4px;
		overflow-x: visible;
		padding: 8px 10px 10px;
	}

	.articles-catalog-sidebar__panel .articles-catalog-sidebar__link {
		flex: initial;
		min-height: 44px;
		min-width: 0;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.articles-catalog-sidebar__toggle i {
		transition-duration: .01ms;
	}
}

/* Полоска квоты: сколько бесплатных статей осталось в окне. */
.medvise-quota__dots {
	display: flex;
	gap: 6px;
	margin: 14px 0 10px;
}

.medvise-quota__dot {
	background: var(--med-color-primary, #2563eb);
	border-radius: 50%;
	height: 10px;
	width: 10px;
}

.medvise-quota__dot.is-spent {
	background: var(--med-color-border, #d6dee6);
}

.medvise-quota__left {
	color: var(--med-color-muted, #5d6b78);
	font-size: 14px;
	margin: 0 0 14px;
}

/* Иконка специальности: место держим у всех строк, чтобы список не рвался. */
.articles-catalog-sidebar__link {
	align-items: center;
}

.articles-catalog-sidebar__link > span:not(.articles-catalog-sidebar__icon) {
	flex: 1 1 auto;
}

.articles-catalog-sidebar__icon {
	color: var(--med-color-muted, #5d6b78);
	flex: 0 0 auto;
	height: 22px;
	margin-right: 10px;
	width: 22px;
}

.articles-catalog-sidebar__link:hover .articles-catalog-sidebar__icon,
.articles-catalog-sidebar__link.is-active .articles-catalog-sidebar__icon {
	color: var(--med-color-primary, #1583c4);
}

