.afgf-datasheet-link {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	border: 1px solid rgba(17, 35, 55, 0.15);
	border-radius: 6px;
	background: #fff;
	padding: 0 16px;
}

.afgf-datasheet-link-input {
	flex: 1 1 auto;
	min-width: 0;
	border: none;
	background: transparent;
	padding: 12px 0;
	font-size: 14px;
}

.afgf-datasheet-link-input:focus {
	outline: none;
}

/*
 * File attached — the text box is swapped for a read-only name display.
 * The name part shrinks with an ellipsis; the end part (the file type)
 * never shrinks, so long names are cut at the end, keep their type, and never
 * run under the "×" / Attach buttons.
 */
.afgf-datasheet-link.has-file .afgf-datasheet-link-input {
	display: none;
}

.afgf-datasheet-link-name {
	display: none;
	flex: 1 1 auto;
	min-width: 0;
	padding: 12px 0 12px 0;
	font-size: 14px;
	white-space: nowrap;
	cursor: default;
}

.afgf-datasheet-link.has-file .afgf-datasheet-link-name {
	display: flex;
}

.afgf-datasheet-link-name-start {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.afgf-datasheet-link-name-end {
	flex: 0 0 auto;
	margin-right: 20px;
}

.afgf-datasheet-link-remove {
	display: none;
	flex: 0 0 auto;
	border: none;
	background: transparent;
	padding: 0 4px;
	font-size: 18px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
}

.afgf-datasheet-link.has-file .afgf-datasheet-link-remove {
	display: block;
}

.afgf-datasheet-link-remove:hover {
	color: #e11d48;
}

.afgf-datasheet-link-attach {
	flex: 0 0 auto;
	border: none;
	background: transparent;
	padding: 0 0 0 12px;
	color: var(--mod_orange, #ff6200);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
}

.afgf-datasheet-link-attach:hover {
	text-decoration: underline;
}

/*
 * Gravity Forms' own real <input type="file"> — kept clickable (unlike
 * display:none, which some browsers refuse to open a file dialog for
 * programmatically) but visually and layout-wise invisible.
 */
.afgf-datasheet-link-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}
