/* Responsive tables in content and GDZ AI blocks */
.table-scroll-x {
	position: relative;
	margin: 12px 0;
	padding-top: 0;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	border: 1px solid #d9e2ec;
	border-radius: 12px;
	background: #fff;
	scrollbar-width: thin;
	box-sizing: border-box;
}
.table-scroll-x > table {
	margin: 0;
	width: max-content !important;
	min-width: 100%;
	max-width: none !important;
	table-layout: auto !important;
}
.table-scroll-x > table th,
.table-scroll-x > table td {
	box-sizing: border-box;
	line-height: 1.45;
}
.table-scroll-x > table th {
	overflow-wrap: anywhere;
	word-break: normal;
	hyphens: auto;
}
.table-scroll-x > table td {
	overflow-wrap: anywhere;
	word-break: normal;
	hyphens: auto;
}
.table-scroll-x > table.gdz-table-auto-center th {
	text-align: center;
	vertical-align: middle;
	min-width: 148px;
	max-width: 260px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
	hyphens: auto;
	line-height: 1.35;
	text-wrap: balance;
}
.table-scroll-x > table.gdz-table-auto-center td {
	text-align: center;
	vertical-align: middle;
	white-space: normal;
	overflow-wrap: anywhere;
	hyphens: auto;
}
.table-scroll-x > table.gdz-table-auto-left th,
.table-scroll-x > table.gdz-table-auto-left td {
	text-align: left;
	vertical-align: top;
	min-width: 136px;
	max-width: 260px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
	hyphens: auto;
}
.table-scroll-x > table.gdz-table-auto-left th:first-child,
.table-scroll-x > table.gdz-table-auto-left td:first-child {
	min-width: 116px;
	max-width: 184px;
}
.table-scroll-x > table.gdz-table-measured th,
.table-scroll-x > table.gdz-table-measured td {
	min-width: 0 !important;
	max-width: none !important;
	overflow-wrap: anywhere;
	word-break: normal;
	hyphens: auto;
}
.table-scroll-x > table.gdz-table-measured th {
	overflow-wrap: anywhere;
}
.table-scroll-x > table.gdz-table-with-math {
	width: 100% !important;
}
.table-scroll-x > table.gdz-table-with-math :is(th, td) {
	max-width: none !important;
}

/* Formula width contributes to its column. The table wrapper handles overflow. */
:is(#content, .gdzai, .gdzai-text, .gdzai-history-answer, .gdzai-answer-block__body, .gdzai-live-body)
.table-scroll-x > table.gdz-table-with-math :is(th, td) :is(mjx-container, .MathJax, .katex-display, .gdzai-math-block) {
	width: max-content !important;
	max-width: none !important;
	overflow: visible !important;
}
.table-scroll-x > table .gdz-cell-force-left {
	text-align: left !important;
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: normal !important;
	hyphens: auto !important;
	line-height: 1.35;
}
.table-scroll-x > table .gdz-cell-force-center {
	text-align: center !important;
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: normal !important;
	hyphens: auto !important;
}
.table-scroll-x > table .gdz-cell-force-right {
	text-align: right !important;
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: normal !important;
	hyphens: auto !important;
}
.table-scroll-x > table th.gdz-cell-force-center,
.table-scroll-x > table th.gdz-cell-force-right {
	white-space: normal !important;
	overflow-wrap: anywhere !important;
	word-break: normal !important;
	hyphens: auto !important;
	line-height: 1.35;
	text-wrap: balance;
}
.fullstory .table-scroll-x > .gdzai-table:not(.gdz-table-with-math) {
	width: max-content !important;
	min-width: 100%;
	max-width: none !important;
}
.table-scroll-x::before {
	content: "↔ Пролистайте таблицу";
	position: absolute;
	left: 8px;
	top: 3px;
	display: none;
	align-items: center;
	padding: 2px 8px;
	max-width: calc(100% - 16px);
	font-size: 11px;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #3b4a5a;
	background: rgba(255,255,255,.95);
	border: 1px solid #d9e2ec;
	border-radius: 999px;
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-2px);
	transition: opacity .42s ease, transform .42s ease, visibility 0s linear .42s;
	z-index: 2;
}
.table-scroll-x::after {
	content: none;
	display: none;
}
.table-scroll-x.has-custom-scroll {
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.table-scroll-x.has-custom-scroll::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}
.gdz-table-scroll-ui {
	margin: 8px 0 14px;
	width: 100%;
	box-sizing: border-box;
}
.gdz-table-scroll-ui[hidden] {
	display: none;
}
.gdz-table-scrollhint { display: none !important; }
.gdz-table-scroll-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-width: 0;
	user-select: none;
	-webkit-user-select: none;
}
.gdz-table-scroll-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 30px;
	padding: 0;
	border: 1px solid #cfd7e3;
	border-radius: 8px;
	background: #f7f9fc;
	color: #4f627b;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.gdz-table-scroll-arrow:hover:not(:disabled) {
	background: #eaf0fb;
	border-color: #b8c8df;
	color: #345077;
}
.gdz-table-scroll-arrow:focus-visible {
	outline: 2px solid #7fa9f4;
	outline-offset: 1px;
}
.gdz-table-scroll-arrow:disabled,
.gdz-table-scroll-arrow.is-disabled {
	opacity: .45;
	cursor: default;
	pointer-events: none;
}
.gdz-table-scrollbar {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	height: 18px;
	padding: 0 10px;
	border-radius: 999px;
	background: linear-gradient(180deg, #eef2f8 0%, #e2e8f2 100%);
	border: 1px solid #cfd7e3;
	box-shadow: inset 0 1px 1px rgba(20, 33, 55, 0.08);
	box-sizing: border-box;
	cursor: pointer;
	touch-action: none;
}
.gdz-table-scrollbar::before,
.gdz-table-scrollbar::after {
	content: none !important;
	display: none !important;
}
.gdz-table-scrollbar-thumb {
	position: absolute;
	top: 2px;
	left: 10px;
	height: calc(100% - 4px);
	min-width: 34px;
	border-radius: 999px;
	background: linear-gradient(180deg, #87abdf 0%, #5f89ca 100%);
	box-shadow: 0 1px 2px rgba(20, 33, 55, 0.28);
	will-change: transform;
}
@media only screen and (max-width: 900px) {
	.table-scroll-x.is-wide {
		padding-top: 28px;
	}
	.table-scroll-x.is-wide::before {
		display: inline-flex;
	}
	.table-scroll-x.is-wide:not(.has-user-scrolled)::before {
		visibility: visible;
		opacity: 1;
		transform: translateY(0);
		transition-delay: 0s;
	}
}
@media only screen and (max-width: 760px) {
	.table-scroll-x > table.gdz-table-auto-left th,
	.table-scroll-x > table.gdz-table-auto-left td {
		min-width: 124px;
		max-width: 210px;
	}
	.table-scroll-x > table.gdz-table-auto-left th:first-child,
	.table-scroll-x > table.gdz-table-auto-left td:first-child {
		min-width: 104px;
		max-width: 156px;
	}
	.gdz-table-scroll-ui {
		margin: 6px 0 12px;
	}
	.gdz-table-scroll-controls {
		gap: 6px;
	}
	.gdz-table-scroll-arrow {
		width: 30px;
		height: 28px;
		border-radius: 9px;
		font-size: 14px;
	}
	.gdz-table-scrollbar {
		height: 18px;
		padding: 0 8px;
	}
	.gdz-table-scrollbar-thumb {
		left: 8px;
		min-width: 30px;
	}
}
