.mw-static-cite-preview-wrap {
	display: inline-block;
	position: relative;
	padding-bottom: 0.45rem;
	margin-bottom: -0.45rem;
}

.mw-static-cite-preview {
	position: absolute;
	z-index: 1000;
	top: 100%;
	left: 0;
	box-sizing: border-box;
	width: min(34rem, 82vw);
	max-height: min(55vh, 28rem);
	overflow: auto;
	padding: 0.75rem 1rem;
	border: 1px solid #a2a9b1;
	border-radius: 0.25rem;
	background: #fff;
	color: #202122;
	box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
	font-size: 0.875rem;
	line-height: 1.55;
	text-align: left;
}

.mw-static-cite-preview[hidden] {
	display: none !important;
}

.mw-static-cite-preview p:first-child,
.mw-static-cite-preview ul:first-child,
.mw-static-cite-preview ol:first-child {
	margin-top: 0;
}

.mw-static-cite-preview p:last-child,
.mw-static-cite-preview ul:last-child,
.mw-static-cite-preview ol:last-child {
	margin-bottom: 0;
}

.mw-static-cite-preview img {
	max-width: 100%;
	height: auto;
}

.mw-static-cite-drawer-backdrop,
.mw-static-cite-drawer {
	display: none;
}

@media (hover: none), (pointer: coarse), (max-width: 720px) {
	.mw-static-cite-preview-wrap {
		display: inline;
		position: static;
		padding: 0;
		margin: 0;
	}

	.mw-static-cite-preview {
		display: none !important;
	}

	.mw-static-cite-drawer-backdrop:not([hidden]) {
		position: fixed;
		z-index: 1200;
		inset: 0;
		display: block;
		background: rgb(0 0 0 / 18%);
	}

	.mw-static-cite-drawer:not([hidden]) {
		position: fixed;
		z-index: 1201;
		right: 0;
		bottom: 0;
		left: 0;
		box-sizing: border-box;
		display: block;
		max-height: min(48vh, 28rem);
		padding-bottom: env(safe-area-inset-bottom);
		border-radius: 0.4rem 0.4rem 0 0;
		background: #000;
		color: #f8f9fa;
		box-shadow: 0 -2px 12px rgb(0 0 0 / 30%);
		font-size: 1rem;
	}

	.mw-static-cite-drawer > header {
		display: flex;
		align-items: center;
		gap: 0.75rem;
		min-height: 3.5rem;
		padding: 0 1rem;
		border-bottom: 1px solid #3a3a3a;
		color: #a2a9b1;
	}

	.mw-static-cite-drawer > header button {
		margin-left: auto;
		padding: 0.15rem 0.4rem;
		border: 0;
		background: transparent;
		color: #f8f9fa;
		font-size: 2rem;
		line-height: 1;
		cursor: pointer;
	}

	.mw-static-cite-drawer-content {
		max-height: calc(min(48vh, 28rem) - 3.5rem - env(safe-area-inset-bottom));
		overflow: auto;
		padding: 1rem 1.25rem 1.25rem;
		line-height: 1.6;
	}

	.mw-static-cite-drawer-content a {
		color: #8ab4f8;
	}

	.mw-static-cite-drawer-content > :first-child {
		margin-top: 0;
	}

	.mw-static-cite-drawer-content > :last-child {
		margin-bottom: 0;
	}
}


@media all {
	body.mw-mf .mw-static-cite-preview-wrap {
		display: inline;
		position: static;
		padding: 0;
		margin: 0;
	}

	body.mw-mf .mw-static-cite-preview {
		display: none !important;
	}

	body.mw-mf .mw-static-cite-drawer-backdrop:not([hidden]) {
		position: fixed;
		z-index: 1200;
		inset: 0;
		display: block;
		background: rgb(0 0 0 / 18%);
	}

	body.mw-mf .mw-static-cite-drawer:not([hidden]) {
		position: fixed;
		z-index: 1201;
		right: 0;
		bottom: 0;
		left: 0;
		box-sizing: border-box;
		display: block;
		max-height: min(48vh, 28rem);
		padding-bottom: env(safe-area-inset-bottom);
		border-radius: 0.4rem 0.4rem 0 0;
		background: #000;
		color: #f8f9fa;
		box-shadow: 0 -2px 12px rgb(0 0 0 / 30%);
		font-size: 1rem;
	}

	body.mw-mf .mw-static-cite-drawer > header {
		display: flex;
		align-items: center;
		gap: 0.75rem;
		min-height: 3.5rem;
		padding: 0 1rem;
		border-bottom: 1px solid #3a3a3a;
		color: #a2a9b1;
	}

	body.mw-mf .mw-static-cite-drawer > header button {
		margin-left: auto;
		padding: 0.15rem 0.4rem;
		border: 0;
		background: transparent;
		color: #f8f9fa;
		font-size: 2rem;
		line-height: 1;
		cursor: pointer;
	}

	body.mw-mf .mw-static-cite-drawer-content {
		max-height: calc(min(48vh, 28rem) - 3.5rem - env(safe-area-inset-bottom));
		overflow: auto;
		padding: 1rem 1.25rem 1.25rem;
		line-height: 1.6;
	}

	body.mw-mf .mw-static-cite-drawer-content a {
		color: #8ab4f8;
	}

	body.mw-mf .mw-static-cite-drawer-content > :first-child { margin-top: 0; }
	body.mw-mf .mw-static-cite-drawer-content > :last-child { margin-bottom: 0; }
}
