.dm-template-detail {
	border-left: 1px solid var(--border);
	border-right: 1px solid var(--border);
}

.dm-template-detail__hero {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 28px;
	flex-wrap: wrap;
	margin-top: 18px;
}

.dm-template-detail__title-row {
	display: flex;
	align-items: center;
	gap: 13px;
	margin-bottom: 14px;
}

.dm-template-detail__fw-tile {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	background: var(--fw-color, #14151a);
	display: grid;
	place-items: center;
	flex: none;
}

.dm-template-detail__tagline {
	font-size: 14px;
	color: var(--text-secondary);
	margin: 4px 0 0;
}

.dm-template-detail__meta {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	font-size: 13.5px;
	color: var(--text-secondary);
}

.dm-template-detail__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.dm-template-detail__meta-avatar {
	width: 24px;
	height: 24px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	font-size: 9px;
	font-weight: 600;
	color: hsl(var(--avatar-hue) 55% 32%);
	background: hsl(var(--avatar-hue) 60% 92%);
	border: 1px solid hsl(var(--avatar-hue) 45% 84%);
}

.dm-template-detail__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.dm-template-detail__save.is-saved,
.dm-template-detail__save.is-saved:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.dm-template-detail__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 352px);
	gap: clamp(28px, 3vw, 48px);
	align-items: start;
}

.dm-template-detail__main {
	display: flex;
	flex-direction: column;
	gap: clamp(32px, 4vw, 52px);
	min-width: 0;
}

.dm-template-detail__sidebar {
	position: sticky;
	top: var(--sticky-top);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.dm-template-preview__frame {
	border: 1px solid var(--border);
	border-radius: 18px;
	overflow: hidden;
	background: #0b0b0c;
	box-shadow: 0 30px 70px -40px rgba(11, 11, 12, 0.5);
}

.dm-template-preview__toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 52px;
	padding: 0 16px;
	background: #141416;
	border-bottom: 1px solid #232326;
}

.dm-template-preview__dots {
	display: flex;
	gap: 7px;
}

.dm-template-preview__dots span {
	width: 11px;
	height: 11px;
	border-radius: 999px;
	background: #3a3a3e;
}

.dm-template-preview__url {
	flex: 1;
	display: flex;
	justify-content: center;
}

.dm-template-preview__url > span:last-child {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 30px;
	padding: 0 14px;
	max-width: 340px;
	width: 100%;
	background: #0b0b0c;
	border: 1px solid #2a2a2e;
	border-radius: 999px;
	font-family: var(--font-mono);
	font-size: 11px;
	color: #86868c;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dm-template-preview__live-dot {
	color: #0e9f6e;
}

.dm-template-preview__open {
	display: inline-flex;
	align-items: center;
	height: 32px;
	padding: 0 14px;
	background: #fff;
	color: #0b0b0c;
	border-radius: 8px;
	font-size: 12.5px;
	font-weight: 600;
	flex: none;
	margin-left: auto;
}

.dm-template-preview__stage {
	position: relative;
	height: min(800px, 70vh);
	background: #0b0b0c;
	overflow: hidden;
}

.dm-template-preview__poster {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	object-position: top;
	background: #fff;
}

.dm-template-screens__head,
.dm-template-changelog__head,
.dm-template-detail__related-head,
.dm-template-detail__more-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.dm-template-screens__panel {
	border-radius: 20px;
	background: linear-gradient(
		150deg,
		color-mix(in srgb, var(--accent) 14%, var(--bg-subtle)),
		var(--bg-subtle)
	);
	border: 1px solid var(--border);
	padding: clamp(16px, 2.2vw, 32px);
}

.dm-template-screens__main {
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--surface);
	box-shadow: 0 24px 54px -34px rgba(11, 11, 12, 0.5);
}

.dm-template-screens__chrome {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px;
	background: var(--surface-hover);
	border-bottom: 1px solid var(--border);
}

.dm-template-screens__chrome span:not(.dm-template-screens__caption) {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: var(--border-strong);
}

.dm-template-screens__caption {
	margin-left: 8px;
	font-family: var(--font-mono);
	font-size: 10px;
	color: var(--text-muted);
}

.dm-template-screens__hero {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--surface-hover);
}

.dm-template-screens__hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
	display: block;
}

.dm-template-screens__thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-top: 14px;
}

.dm-template-screens__thumb {
	padding: 0;
	overflow: hidden;
	border-radius: 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	text-align: left;
	cursor: pointer;
	transition: all 0.2s ease;
}

.dm-template-screens__thumb.is-active {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.dm-template-screens__thumb-img {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--surface-hover);
}

.dm-template-screens__thumb-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
	display: block;
}

.dm-template-screens__thumb > span {
	display: block;
	padding: 7px 9px;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--text-secondary);
}

.dm-template-detail__features-title {
	font-size: 16px;
	font-weight: 600;
	margin: 28px 0 14px;
}

.dm-template-detail__features {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 10px 20px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.dm-template-detail__features li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14.5px;
	color: var(--text-secondary);
}

.dm-template-detail__features span {
	color: var(--accent);
	font-weight: 600;
	flex: none;
}

.dm-template-changelog__item {
	display: grid;
	grid-template-columns: 132px 1fr;
	gap: 20px;
	padding-bottom: 22px;
}

.dm-template-changelog__version {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	height: 22px;
	padding: 0 10px;
	border-radius: 999px;
	background: var(--surface-hover);
	color: var(--text-secondary);
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 600;
}

.dm-template-changelog__version.is-current {
	background: color-mix(in srgb, var(--accent) 12%, var(--surface));
	color: var(--accent);
}

.dm-template-changelog__date {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-muted);
}

.dm-template-changelog__body {
	border-left: 1px solid var(--border);
	padding-left: 20px;
}

.dm-template-changelog__title {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 8px;
}

.dm-template-changelog__body ul {
	margin: 0;
	padding-left: 16px;
	font-size: 14px;
	line-height: 22px;
	color: var(--text-secondary);
}

.dm-template-buy {
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--surface);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.dm-template-buy__top {
	padding: 22px 22px 20px;
	border-bottom: 1px solid var(--border);
}

.dm-template-buy__price-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	margin-bottom: 16px;
}

.dm-template-buy__price {
	font-family: var(--heading-font);
	font-size: 34px;
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1;
}

.dm-template-buy__price.is-free {
	color: #0e9f6e;
}

.dm-template-buy__note {
	font-size: 13px;
	color: var(--text-muted);
	padding-bottom: 4px;
}

.dm-template-buy__cta,
.dm-template-buy__preview {
	width: 100%;
	justify-content: center;
	margin-bottom: 10px;
}

.dm-template-buy__guarantee {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin: 14px 0 0;
	font-size: 12.5px;
	color: var(--text-muted);
}

.dm-template-buy__details {
	padding: 18px 22px 22px;
}

.dm-template-buy__specs {
	margin: 0;
}

.dm-template-buy__spec {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 0;
	border-top: 1px solid var(--border);
	font-size: 13.5px;
}

.dm-template-buy__spec dt {
	margin: 0;
	color: var(--text-muted);
}

.dm-template-buy__spec dd {
	margin: 0;
	font-weight: 500;
	text-align: right;
}

.dm-template-buy__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	padding: 0 22px 22px;
}

.dm-template-author-card {
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--surface);
	box-shadow: var(--shadow);
	padding: 20px 22px;
}

.dm-template-author-card__head {
	display: flex;
	align-items: center;
	gap: 13px;
	margin-bottom: 16px;
}

.dm-template-author-card__avatar {
	width: 48px;
	height: 48px;
	border-radius: 14px;
	object-fit: cover;
	flex: none;
}

.dm-template-author-card__avatar--initial {
	display: grid;
	place-items: center;
	font-size: 16px;
	font-weight: 600;
	color: hsl(var(--avatar-hue) 55% 30%);
	background: hsl(var(--avatar-hue) 60% 92%);
}

.dm-template-author-card__name {
	font-size: 16px;
	font-weight: 600;
}

.dm-template-author-card__subtitle {
	font-size: 13px;
	color: var(--text-muted);
}

.dm-template-author-card__stats {
	display: flex;
	gap: 20px;
	margin-bottom: 16px;
}

.dm-template-author-card__stat-value {
	font-family: var(--heading-font);
	font-size: 18px;
	font-weight: 600;
}

.dm-template-author-card__stat-label {
	font-size: 12px;
	color: var(--text-muted);
}

.dm-template-author-card__profile {
	width: 100%;
	justify-content: center;
}

.dm-template-detail__report {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 12.5px;
	color: var(--text-muted);
}

.dm-template-detail__related {
	border-top: 1px solid var(--border);
	background: var(--bg-subtle);
}

.dm-grid--templates-compact {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: clamp(16px, 1.8vw, 24px);
}

.dm-template-detail__more {
	border-top: 1px solid var(--border);
}

.dm-template-detail__more-head {
	align-items: center;
}

@media (max-width: 980px) {
	.dm-template-detail__layout {
		grid-template-columns: 1fr;
	}

	.dm-template-detail__sidebar {
		position: static;
	}

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

	.dm-template-changelog__item {
		grid-template-columns: 1fr;
	}

	.dm-template-changelog__body {
		border-left: 0;
		padding-left: 0;
	}
}

@media (max-width: 640px) {
	.dm-template-detail__actions {
		width: 100%;
	}

	.dm-template-detail__actions .dm-btn {
		flex: 1;
		justify-content: center;
	}
}
