[appearance-page] {
	max-width: 72rem;
}

[appearance-heading] {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

[appearance-heading] > div {
	flex: 1 1 25rem;
}

[appearance-heading] h1,
[appearance-heading] h2 {
	margin: 0 0 .5rem;
}

[appearance-heading] p {
	margin: 0;
}

[palette-gallery] {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1rem;
}

[palette-gallery] button {
	background: var(--bg-card);
	color: var(--text-primary);
	border: 1px solid var(--input-border);
	text-align: left;
}

[palette-gallery] button:hover {
	color: var(--text-primary);
	border-color: var(--text-link);
}

[palette-gallery] button[aria-pressed="true"] {
	outline: 2px solid var(--text-link);
	outline-offset: 2px;
}

[palette-gallery] [palette-auto] {
	grid-column: 1 / -1;
	display: flex;
	justify-content: space-between;
	padding: .9rem 1.1rem;
}

[palette-auto] strong,
[palette-auto] small {
	display: block;
}

[palette-gallery] small {
	color: var(--text-muted);
	font-weight: normal;
	line-height: 1.5;
}

[palette-auto] small {
	margin-top: .2rem;
}

[palette-status] {
	color: var(--text-link);
	font-size: .8rem;
}

[palette-gallery] [palette-card] {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 0;
	padding: 0;
	overflow: hidden;
	border-radius: 8px;
}

[palette-art] {
	display: block;
	padding: 1.2rem 1.5rem 0;
	background: var(--palette-header);
}

[palette-window] {
	position: relative;
	display: block;
	height: 5rem;
	padding: .7rem;
	border: 1px solid #ffffff40;
	border-bottom: 0;
	border-radius: 6px 6px 0 0;
	background: var(--palette-surface);
	box-shadow: 0 4px 14px #00000018;
}

[palette-window] > span {
	display: block;
	height: .4rem;
	width: 45%;
	margin-bottom: .6rem;
	border-radius: 3px;
	background: var(--palette-header);
}

[palette-window] i {
	display: block;
	height: .25rem;
	margin: .4rem 0;
	width: 72%;
	background: var(--palette-accent);
	opacity: .25;
}

[palette-window] i + i {
	width: 50%;
}

[palette-window] b {
	position: absolute;
	right: .7rem;
	bottom: .65rem;
	width: 2.4rem;
	height: .8rem;
	border-radius: 3px;
	background: var(--palette-accent);
}

[palette-copy] {
	padding: .85rem 1rem 1rem;
}

[palette-title] {
	display: flex;
	justify-content: space-between;
	gap: .5rem;
	margin-bottom: .35rem;
}

[palette-title] > span {
	color: var(--text-muted);
	font-size: .75rem;
	font-weight: normal;
}

[palette-copy] small {
	display: block;
}

[custom-theme] {
	scroll-margin-top: 7rem;
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--input-border);
}

[custom-theme-form] fieldset {
	min-width: 0;
	margin: 0 0 1.5rem;
	padding: 1.25rem;
	border: 1px solid var(--input-border);
	border-radius: 8px;
}

[custom-theme-form] legend {
	padding-inline: .5rem;
	font-weight: bold;
}

[custom-colors] {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

[color-field] {
	display: flex;
	align-items: center;
	gap: .85rem;
	padding: .75rem;
	background: var(--bg-card);
	border: 1px solid var(--border-card);
	border-radius: 6px;
	cursor: pointer;
}

[color-field] input {
	flex: 0 0 3rem;
	width: 3rem;
	height: 3rem;
	padding: .2rem;
	border: 1px solid var(--input-border);
	border-radius: 6px;
	background: var(--input-bg);
	cursor: pointer;
}

[color-field] strong,
[color-field] small {
	display: block;
}

[color-field] small {
	color: var(--text-muted);
	margin-top: .15rem;
}

[background-controls] {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

[background-controls] label {
	font-size: .9rem;
}

[background-controls] select {
	display: block;
	width: 100%;
	margin-top: .35rem;
}

[custom-save] > div {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
}

[custom-save] > p {
	margin-bottom: 0;
}

[appearance-notice],
[appearance-error] {
	padding: 1rem 1.2rem;
	border: 1px solid var(--input-border);
	border-left: 4px solid var(--text-link);
	border-radius: 6px;
	background: var(--input-bg);
}

[appearance-error] {
	border-left-color: #963d42;
}

@media (max-width: 1100px) {
	[palette-gallery] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 850px) {
	[palette-gallery] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	[palette-gallery] {
		gap: .75rem;
	}

	[palette-art] {
		padding: .85rem .6rem 0;
	}

	[palette-copy] {
		padding: .7rem;
	}

	[palette-title] {
		flex-direction: column;
		gap: 0;
	}

	[custom-colors],
	[background-controls] {
		grid-template-columns: 1fr;
	}

	[custom-theme-form] fieldset {
		padding: .85rem;
	}

	[custom-theme] {
		scroll-margin-top: 10rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	[palette-gallery] button {
		transition: none;
	}

	[palette-gallery] button:hover,
	[palette-gallery] button:active {
		transform: none;
	}
}
