#ytd-form,
#ytd-form * {
	box-sizing: border-box;
}

.ytd-wrapper {
	width: 100%;
	max-width: 920px;
	margin: 30px auto;
	padding: 0 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ytd-card {
	background: #ffffff;
	border: 1px solid #e7e7e7;
	border-radius: 20px;
	padding: 30px;
	box-shadow: 0 12px 40px rgba(0,0,0,.07);
	color: #171717;
}

.ytd-heading {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-bottom: 26px;
}

.ytd-icon {
	width: 48px;
	height: 48px;
	border-radius: 14px;
	display: grid;
	place-items: center;
	background: #111827;
	color: #fff;
	font-size: 21px;
	flex: 0 0 48px;
}

.ytd-heading h2 {
	margin: 0 0 5px;
	font-size: 25px;
	line-height: 1.2;
	font-weight: 750;
}

.ytd-heading p {
	margin: 0;
	color: #6b7280;
	font-size: 14px;
	line-height: 1.5;
}

.ytd-form label {
	display: block;
	font-size: 14px;
	font-weight: 650;
	margin-bottom: 9px;
}

.ytd-input-row {
	display: flex;
	gap: 10px;
}

.ytd-input-row input {
	min-width: 0;
	flex: 1;
	height: 50px;
	border: 1px solid #d8dce2;
	border-radius: 11px;
	padding: 0 15px;
	font-size: 15px;
	outline: none;
	background: #fff;
	color: #111827;
}

.ytd-input-row input:focus {
	border-color: #111827;
	box-shadow: 0 0 0 3px rgba(17,24,39,.08);
}

.ytd-fetch-btn,
.ytd-download-btn {
	border: 0;
	cursor: pointer;
	font-weight: 700;
	transition: transform .15s ease, opacity .15s ease;
}

.ytd-fetch-btn {
	background: #111827;
	color: #fff;
	padding: 0 20px;
	border-radius: 11px;
	white-space: nowrap;
}

.ytd-fetch-btn:hover,
.ytd-download-btn:hover {
	transform: translateY(-1px);
}

.ytd-fetch-btn:disabled,
.ytd-download-btn:disabled {
	opacity: .6;
	cursor: wait;
	transform: none;
}

.ytd-message {
	min-height: 20px;
	margin: 14px 0 0;
	font-size: 14px;
}

.ytd-message.ytd-success {
	color: #16734b;
}

.ytd-message.ytd-error {
	color: #b42318;
}

.ytd-loader {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0;
	color: #4b5563;
	font-size: 14px;
}

.ytd-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #d1d5db;
	border-top-color: #111827;
	border-radius: 50%;
	animation: ytd-spin .7s linear infinite;
}

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

.ytd-result {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #ededed;
}

.ytd-preview-label {
	font-size: 13px;
	font-weight: 750;
	margin-bottom: 10px;
	color: #374151;
}

.ytd-image-wrap {
	overflow: hidden;
	background: #f3f4f6;
	border-radius: 14px;
	border: 1px solid #e5e7eb;
	text-align: center;
}

.ytd-image-wrap img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 520px;
	object-fit: contain;
	margin: 0 auto;
}

.ytd-downloads {
	margin-top: 22px;
}

.ytd-resolution-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.ytd-download-btn {
	background: #f3f4f6;
	color: #111827;
	border: 1px solid #e5e7eb;
	border-radius: 11px;
	padding: 13px 10px;
	font-size: 14px;
}

.ytd-download-btn span {
	display: block;
	font-size: 11px;
	font-weight: 500;
	color: #6b7280;
	margin-top: 3px;
}

.ytd-note {
	margin: 20px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: #7b8190;
	text-align: center;
}

@media (max-width: 680px) {
	.ytd-card {
		padding: 20px;
		border-radius: 16px;
	}

	.ytd-heading h2 {
		font-size: 21px;
	}

	.ytd-input-row {
		flex-direction: column;
	}

	.ytd-fetch-btn {
		height: 48px;
	}

	.ytd-resolution-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 390px) {
	.ytd-resolution-grid {
		grid-template-columns: 1fr;
	}
}
