/* Mobile skin for legacy PhotoPost/vBulletin gallery pages. */
:root {
	--gallery-mobile-page: #efefe9;
	--gallery-mobile-surface: #ffffff;
	--gallery-mobile-border: #d6d6cf;
	--gallery-mobile-primary: #660033;
	--gallery-mobile-accent: #911e42;
	--gallery-mobile-soft: #fff0f5;
	--gallery-mobile-muted: #5f5660;
	--gallery-mobile-text: #151015;
}

body {
	min-width: 0 !important;
}

img,
object,
embed {
	max-width: 100%;
	height: auto;
}

input,
select,
textarea {
	box-sizing: border-box;
	max-width: 100%;
}

@media screen and (max-width: 760px) {
	html {
		-webkit-text-size-adjust: 100%;
		background: var(--gallery-mobile-page);
	}

	body,
	td,
	th,
	input,
	select,
	textarea {
		font-size: 14px !important;
		line-height: 1.45;
	}

	body {
		margin: 0 !important;
		padding: 0 !important;
		overflow-x: hidden;
		background: var(--gallery-mobile-page) !important;
		color: var(--gallery-mobile-text);
	}

	body > table[width="990"] {
		display: block !important;
		box-sizing: border-box;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		background: var(--gallery-mobile-surface);
	}

	body > table[width="990"] > tbody,
	body > table[width="990"] > tbody > tr,
	body > table[width="990"] > tbody > tr > td {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		padding: 0 !important;
	}

	body > table[width="990"] > tbody > tr:first-child {
		min-height: 60px;
		background: #ffffff url("https://legscorrection.ru/image/header/logo_mob.JPG") repeat-x left top;
	}

	body > table[width="990"] > tbody > tr:first-child table,
	body > table[width="990"] > tbody > tr:first-child img {
		display: none !important;
	}

	.menugl {
		display: block !important;
		box-sizing: border-box;
		height: auto !important;
		padding: 4px 3px !important;
		background: var(--gallery-mobile-primary) !important;
	}

	.menugl ul {
		display: flex !important;
		flex-wrap: nowrap;
		justify-content: space-between;
		gap: 2px;
		margin: 0 !important;
		padding: 0 !important;
		list-style: none !important;
	}

	.menugl li {
		display: block !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.menugl a {
		display: block;
		padding: 6px 2px;
		border-radius: 4px;
		color: #ffffff !important;
		text-decoration: none !important;
		font-weight: bold;
		font-size: 12px !important;
		line-height: 1.1;
		white-space: nowrap;
	}

	.menugl a:active,
	.menugl a:hover {
		background: rgba(255, 255, 255, 0.14);
	}

	.page,
	.bodywrapping {
		box-sizing: border-box;
		width: 95% !important;
		max-width: 95% !important;
		margin: 0 auto !important;
		padding: 0 4px 8px !important;
		background: var(--gallery-mobile-surface);
		border: 1px solid var(--gallery-mobile-border);
		border-top: 0;
		border-radius: 0 0 4px 4px;
		text-align: left !important;
	}

	.page > div[style*="padding"] {
		padding: 0 !important;
	}

	.page > div[align="left"] > br {
		display: none !important;
	}

	.vbmenu_popup {
		display: none !important;
	}

	div[style*="height:350px"],
	#yandex_rtb_R-A-141282-1,
	#ya-site-form0,
	.ya-site-form {
		display: none !important;
	}

	a {
		overflow-wrap: break-word;
	}

	table {
		max-width: 100% !important;
	}

	table[width],
	td[width],
	th[width] {
		width: auto !important;
		max-width: 100% !important;
	}

	table[width="100%"],
	.tborder {
		width: 100% !important;
	}

	.tborder {
		box-sizing: border-box;
		margin: 8px 0 !important;
		border: 0 !important;
		background: transparent !important;
	}

	.alt1,
	.alt2,
	.thead,
	.tfoot,
	.vbmenu_control,
	.vbmenu_option,
	.panelsurround {
		padding: 8px !important;
	}

	.smallfont {
		font-size: 13px !important;
		line-height: 1.4;
	}

	.navbar {
		display: block;
		box-sizing: border-box;
		width: 100% !important;
		margin: 6px 0 !important;
		padding: 6px 8px !important;
		border-radius: 4px;
		background: var(--gallery-mobile-primary) !important;
		color: #ffffff !important;
		text-align: center;
		white-space: normal !important;
	}

	.navbar a,
	.navbar a:link,
	.navbar a:visited {
		color: #ffffff !important;
		text-decoration: none !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type {
		margin: 5px 0 !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type > tbody,
	.page > div[align="left"] > table.tborder:first-of-type > tbody > tr {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type > tbody > tr {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type > tbody > tr > td {
		display: block !important;
		box-sizing: border-box;
		width: 100% !important;
		padding: 0 !important;
		border: 0 !important;
		background: transparent !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type > tbody > tr > td:first-child {
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type > tbody > tr > td:last-child {
		width: 100% !important;
		padding-top: 5px !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type .navbar {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 30px;
		margin: 0 !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type .navbar img {
		display: none !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table,
	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody > tr {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody > tr:first-child td {
		display: inline !important;
		width: auto !important;
		padding: 0 !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody > tr:first-child td:first-child,
	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody > tr:first-child td:nth-child(2) {
		display: none !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody > tr:first-child .navbar {
		display: inline !important;
		width: auto !important;
		min-height: 0;
		margin: 0 !important;
		padding: 0 !important;
		border-radius: 0;
		background: transparent !important;
		color: var(--gallery-mobile-primary) !important;
		font-size: 12px !important;
		line-height: 1.3;
		text-align: left;
	}

	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody > tr:first-child .navbar a {
		color: var(--gallery-mobile-primary) !important;
		font-weight: bold;
	}

	.page > div[align="left"] > table.tborder:first-of-type .alt1 > table > tbody > tr:nth-child(2) td.navbar {
		display: block !important;
		width: 100% !important;
		min-height: 0;
		margin: 5px 0 0 !important;
		padding: 6px 8px !important;
		background: var(--gallery-mobile-primary) !important;
		color: #ffffff !important;
		font-size: 13px !important;
		line-height: 1.25;
		text-align: left;
	}

	.page > div[align="left"] > table.tborder:first-of-type form {
		max-width: 268px;
		margin: 0 !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type form table,
	.page > div[align="left"] > table.tborder:first-of-type form tbody {
		display: block !important;
		width: auto !important;
		max-width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type form tbody {
		display: grid !important;
		grid-template-columns: 138px auto;
		gap: 3px 6px;
		align-items: center;
	}

	.page > div[align="left"] > table.tborder:first-of-type form tr {
		display: contents !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type form td {
		display: block !important;
		width: auto !important;
		padding: 0 !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type form td.smallfont:not(:has(#cb_cookieuser_navbar)) {
		display: none !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type form input[name="vb_login_username"],
	.page > div[align="left"] > table.tborder:first-of-type form input[name="vb_login_password"] {
		width: 100% !important;
		height: 27px;
		min-height: 27px;
		padding: 3px 6px;
		font-size: 12px !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type form input[type="submit"] {
		height: 27px;
		min-height: 27px;
		padding: 3px 9px;
		font-size: 12px !important;
	}

	.page > div[align="left"] > table.tborder:first-of-type form td:has(#cb_cookieuser_navbar) {
		align-self: center;
		font-size: 11px !important;
		white-space: nowrap !important;
	}

	.page > div[align="left"] > div.tborder {
		box-sizing: border-box;
		margin: 5px 0 !important;
		padding: 0 !important;
		border: 0 !important;
		background: transparent !important;
	}

	.page > div[align="left"] > div.tborder > table,
	.page > div[align="left"] > div.tborder > table > tbody,
	.page > div[align="left"] > div.tborder > table > tbody > tr {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > div.tborder > table > tbody > tr {
		display: flex !important;
		flex-wrap: wrap;
		gap: 3px;
	}

	.page > div[align="left"] > div.tborder td.vbmenu_control {
		display: block !important;
		box-sizing: border-box;
		flex: 1 1 calc(25% - 3px);
		min-width: 0;
		width: auto !important;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 4px;
		background: var(--gallery-mobile-primary) !important;
		text-align: center !important;
	}

	.page > div[align="left"] > div.tborder td.vbmenu_control a {
		display: block;
		padding: 6px 2px;
		color: #ffffff !important;
		font-size: 12px !important;
		font-weight: bold;
		line-height: 1.1;
		text-decoration: none !important;
	}

	.page > div[align="left"] > div.tborder td.vbmenu_control:first-child {
		background: var(--gallery-mobile-accent) !important;
	}

	.page > div[align="left"] > div.tborder td.vbmenu_control img {
		display: none !important;
	}

	.vbmenu_control,
	.vbmenu_option {
		white-space: normal !important;
	}

	form,
	fieldset {
		max-width: 100%;
	}

	input[type="text"],
	input[type="password"],
	input[type="file"],
	input[type="search"],
	select,
	textarea {
		width: 100% !important;
		min-height: 36px;
	}

	input[type="submit"],
	input[type="button"],
	button,
	.button {
		min-height: 38px;
		padding: 8px 12px;
		white-space: normal;
	}

	img[width],
	img[height] {
		height: auto !important;
	}

	a[href*="showimage.php"] img,
	a[href*="browseimages.php"] img,
	img[src*="/gallery/files/"],
	img[src*="/gallery/users/"],
	img[src*="/gallery/image/"],
	img[src*="gallery/files/"],
	img[src*="gallery/users/"],
	img[src*="gallery/image/"] {
		max-width: 100% !important;
		height: auto !important;
	}

	textarea {
		min-height: 96px;
	}

	table.tborder:has(#whatsnew),
	table.tborder:has(#whatspopular),
	table.tborder:has(#gallery_search) {
		display: block !important;
		margin: 8px 0 !important;
		border: 0 !important;
		background: transparent !important;
		overflow: visible !important;
	}

	table.tborder:has(#whatsnew) tbody,
	table.tborder:has(#whatsnew) tr,
	table.tborder:has(#whatspopular) tbody,
	table.tborder:has(#whatspopular) tr,
	table.tborder:has(#gallery_search) tbody,
	table.tborder:has(#gallery_search) tr {
		display: block !important;
		width: 100% !important;
	}

	table.tborder:has(#whatsnew) tr,
	table.tborder:has(#whatspopular) tr,
	table.tborder:has(#gallery_search) tr {
		display: flex !important;
		flex-wrap: wrap;
		gap: 5px;
	}

	table.tborder:has(#whatsnew) td,
	table.tborder:has(#whatspopular) td,
	table.tborder:has(#gallery_search) td {
		display: block !important;
		box-sizing: border-box;
		flex: 1 1 calc(33.333% - 5px);
		min-width: 0;
		width: auto !important;
		padding: 0 !important;
		border: 0 !important;
		background: var(--gallery-mobile-primary) !important;
		border-radius: 4px;
		text-align: center !important;
		white-space: normal !important;
	}

	table.tborder:has(#whatsnew) td a,
	table.tborder:has(#whatspopular) td a,
	table.tborder:has(#gallery_search) td a {
		display: block;
		padding: 6px 4px;
		color: #ffffff !important;
		font-size: 12px !important;
		text-decoration: none !important;
		font-weight: bold;
		line-height: 1.15;
		white-space: normal !important;
	}

	table.tborder:has(#whatsnew) td:nth-last-child(-n+2),
	table.tborder:has(#whatspopular) td:nth-last-child(-n+2),
	table.tborder:has(#gallery_search) td:nth-last-child(-n+2) {
		flex-basis: calc(50% - 5px);
	}

	table.tborder:has(#whatsnew) td .smallfont,
	table.tborder:has(#whatspopular) td .smallfont,
	table.tborder:has(#gallery_search) td .smallfont {
		display: block;
		font-size: 12px !important;
		line-height: 1.15;
	}

	table.tborder:has(#whatsnew) td img,
	table.tborder:has(#whatspopular) td img,
	table.tborder:has(#gallery_search) td img {
		display: none !important;
	}

	table.tborder:has(#whatsnew) td:first-child,
	table.tborder:has(#whatspopular) td:first-child,
	table.tborder:has(#gallery_search) td:first-child {
		background: var(--gallery-mobile-accent) !important;
	}

	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) {
		box-sizing: border-box;
		margin: 7px 0 !important;
		border: 1px solid #dddddd !important;
		border-radius: 4px;
		background: #fffafc !important;
		overflow: hidden;
	}

	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) table,
	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) tbody,
	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) tr {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) td {
		display: block !important;
		box-sizing: border-box;
		width: 100% !important;
		padding: 6px 8px !important;
		border: 0 !important;
		background: transparent !important;
		text-align: left !important;
	}

	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) td[width="30"]:has(> img[src*="announcement.gif"]) {
		display: none !important;
	}

	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) br {
		display: none !important;
	}

	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) img.inlineimg {
		display: none !important;
	}

	.page > div[align="left"] > table.tborder:not(:first-of-type):not(:has(#whatsnew)):not(:has(thead)) div[align="left"] {
		line-height: 1.35;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]) {
		display: block !important;
		margin: 7px 0 !important;
		padding: 6px !important;
		border: 1px solid #dddddd !important;
		border-radius: 4px;
		background: #fffafc !important;
		overflow: visible !important;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]) > tbody,
	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]) > tbody > tr {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]) > tbody > tr {
		display: flex !important;
		flex-wrap: wrap;
		gap: 4px;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]) td {
		display: block !important;
		box-sizing: border-box;
		flex: 0 0 28px;
		width: 28px !important;
		min-width: 28px;
		padding: 0 !important;
		border: 0 !important;
		background: transparent !important;
		text-align: center !important;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]) a {
		display: block;
		padding: 5px 0;
		border: 1px solid #ead7df;
		border-radius: 4px;
		background: #ffffff;
		color: var(--gallery-mobile-primary) !important;
		font-size: 12px !important;
		font-weight: bold;
		line-height: 1;
		text-decoration: none !important;
	}

	table.tborder:has(thead) {
		display: block !important;
		margin: 10px 0 !important;
		border: 0 !important;
		background: transparent !important;
		overflow: visible !important;
	}

	table.tborder:has(thead) > thead {
		display: none !important;
	}

	table.tborder:has(thead) > tbody {
		display: block !important;
		width: 100% !important;
		margin: 0 0 10px !important;
		border: 1px solid #c5d6e2;
		border-radius: 4px;
		background: var(--gallery-mobile-surface);
		overflow: hidden;
	}

	table.tborder:has(thead) > tbody > tr {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
		width: 100% !important;
	}

	table.tborder:has(thead) > tbody > tr > td {
		display: block !important;
		box-sizing: border-box;
		width: auto !important;
		padding: 7px 8px !important;
		border: 0 !important;
		background: var(--gallery-mobile-surface) !important;
		white-space: normal !important;
	}

	table.tborder:has(thead) > tbody > tr > td[colspan="2"] {
		grid-column: 1 / -1;
		padding: 8px !important;
	}

	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table,
	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table > tbody,
	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table > tbody > tr {
		display: block !important;
		width: 100% !important;
	}

	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table > tbody > tr {
		display: grid !important;
		grid-template-columns: 92px 1fr;
		gap: 10px;
		align-items: center;
	}

	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table > tbody > tr > td {
		display: block !important;
		width: auto !important;
		padding: 0 !important;
	}

	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table > tbody > tr > td:nth-child(1),
	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table > tbody > tr > td:nth-child(2),
	table.tborder:has(thead) > tbody > tr > td[colspan="2"] > table > tbody > tr > td:nth-child(4) {
		display: none !important;
	}

	table.tborder:has(thead) > tbody > tr > td[colspan="2"] img[src*="/gallery/files/"],
	table.tborder:has(thead) > tbody > tr > td[colspan="2"] img[src*="gallery/files/"] {
		width: 92px !important;
		height: 78px !important;
		object-fit: cover;
		border-radius: 4px;
	}

	table.tborder:has(thead) > tbody > tr > td[colspan="2"] b a {
		display: block;
		color: var(--gallery-mobile-text) !important;
		text-decoration: none !important;
		font-size: 15px;
		line-height: 1.25;
	}

	table.tborder:has(thead) > tbody > tr > td:nth-child(2),
	table.tborder:has(thead) > tbody > tr > td:nth-child(3) {
		display: none !important;
	}

	table.tborder:has(thead) > tbody > tr > td:nth-child(4),
	table.tborder:has(thead) > tbody > tr > td:nth-child(5) {
		background: var(--gallery-mobile-soft) !important;
		color: var(--gallery-mobile-text);
		font-weight: bold;
		text-align: center !important;
		border-top: 1px solid #ead7df !important;
	}

	table.tborder:has(thead) > tbody > tr > td:nth-child(4)::before {
		content: "Фото";
		display: block;
		color: var(--gallery-mobile-muted);
		font-size: 11px;
		font-weight: normal;
		text-transform: uppercase;
	}

	table.tborder:has(thead) > tbody > tr > td:nth-child(5)::before {
		content: "Ответы";
		display: block;
		color: var(--gallery-mobile-muted);
		font-size: 11px;
		font-weight: normal;
		text-transform: uppercase;
	}
}

@media screen and (max-width: 560px) {
	body > table,
	body > div,
	center > table,
	center > div {
		width: 100% !important;
		max-width: 100% !important;
	}

	.tborder {
		display: block;
		overflow-x: visible;
		-webkit-overflow-scrolling: touch;
	}

	.tborder > tbody,
	.tborder > tbody > tr,
	.tborder > tbody > tr > td {
		max-width: 100% !important;
	}

	.alt1,
	.alt2,
	.thead,
	.tfoot {
		vertical-align: top;
	}
}

@media screen and (max-width: 760px) {
	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]):not(#gallery-mobile-alphabet-fix) {
		display: block !important;
		margin: 7px 0 !important;
		padding: 6px !important;
		border: 1px solid #dddddd !important;
		border-radius: 4px;
		background: #fffafc !important;
		overflow: visible !important;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]):not(#gallery-mobile-alphabet-fix) > tbody,
	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]):not(#gallery-mobile-alphabet-fix) > tbody > tr {
		display: block !important;
		width: 100% !important;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]):not(#gallery-mobile-alphabet-fix) > tbody > tr {
		display: flex !important;
		flex-wrap: wrap;
		gap: 4px;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]):not(#gallery-mobile-alphabet-fix) td {
		display: block !important;
		box-sizing: border-box;
		flex: 0 0 28px !important;
		width: 28px !important;
		min-width: 28px;
		max-width: 28px !important;
		padding: 0 !important;
		border: 0 !important;
		background: transparent !important;
		text-align: center !important;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]):not(#gallery-mobile-alphabet-fix) a {
		display: block;
		padding: 5px 0;
		border: 1px solid #ead7df;
		border-radius: 4px;
		background: #ffffff;
		color: var(--gallery-mobile-primary) !important;
		font-size: 12px !important;
		font-weight: bold;
		line-height: 1;
		text-decoration: none !important;
	}

	.page > div[align="left"] > table.tborder:has(a[href*="ltr="]):not(#gallery-mobile-alphabet-fix) {
		display: none !important;
	}

	table.tborder:has(thead) > tbody > tr > td:nth-child(4)::before {
		content: "\0424\043e\0442\043e";
	}

	table.tborder:has(thead) > tbody > tr > td:nth-child(5)::before {
		content: "\041e\0442\0432\0435\0442\044b";
	}
}
