/* "Color It" — in-browser coloring tool popup.
   Intentionally no transitions/animations anywhere in this file — kept
   instant on purpose so it stays fast even on lower-end phones. */

body.dh-color-it-open {
	overflow: hidden;
}

.dh-color-it {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(26, 26, 26, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.dh-color-it__card {
	width: 100%;
	max-width: 1100px;
	max-height: 90vh;
	background: #fff;
	border-radius: var(--dh-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.dh-color-it__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--dh-cream);
	border-bottom: 1px solid #eee;
	flex-wrap: wrap;
}

.dh-color-it__close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: transparent;
	color: var(--dh-ink);
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.dh-color-it__close:hover {
	background: var(--dh-yellow);
}

.dh-color-it__tools {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dh-color-it__icon-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: var(--dh-ink);
	font-size: 1.1rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.dh-color-it__icon-btn:hover {
	background: var(--dh-yellow);
}

.dh-color-it__sm-btn {
	padding: 8px 18px;
	font-size: 0.9rem;
}

.dh-color-it__body {
	flex: 1;
	display: flex;
	min-height: 0;
}

.dh-color-it__stage {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: auto;
	padding: 24px;
	background: #fafaf8;
}

.dh-color-it__status {
	color: #777;
	font-size: 1rem;
}

.dh-color-it__canvas-wrap {
	position: relative;
	display: inline-block;
	transform-origin: center;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.dh-color-it__fill-canvas {
	display: block;
	max-width: calc(100vw - 340px);
	max-height: calc(90vh - 220px);
	width: auto;
	height: auto;
}

.dh-color-it__line-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	cursor: crosshair;
}

.dh-color-it__sidebar {
	width: 220px;
	flex: 0 0 220px;
	background: #fff;
	border-left: 1px solid #eee;
	padding: 20px 16px;
	overflow-y: auto;
}

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

.dh-color-it__swatch {
	width: 100%;
	aspect-ratio: 1;
	border-radius: 50%;
	border: 3px solid transparent;
	cursor: pointer;
	padding: 0;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.dh-color-it__swatch.is-active {
	border-color: var(--dh-pink);
	box-shadow: 0 0 0 2px rgba(204, 51, 102, 0.2);
}

.dh-color-it__add-color {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid #eee;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.dh-color-it__color-input {
	width: 100%;
	height: 40px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: none;
	cursor: pointer;
	padding: 3px;
}

@media (max-width: 700px) {
	.dh-color-it {
		padding: 0;
	}

	.dh-color-it__card {
		max-width: 100%;
		max-height: 100%;
		height: 100%;
		border-radius: 0;
	}

	.dh-color-it__body {
		flex-direction: column;
	}

	.dh-color-it__stage {
		padding: 12px;
	}

	.dh-color-it__fill-canvas {
		max-width: calc(100vw - 24px);
		max-height: 48vh;
	}

	.dh-color-it__sidebar {
		width: auto;
		flex: 0 0 auto;
		border-left: 0;
		border-top: 1px solid #eee;
		padding: 12px 16px 20px;
	}

	.dh-color-it__palette {
		grid-template-columns: repeat(5, 1fr);
		max-width: 260px;
		margin-inline: auto;
	}

	.dh-color-it__add-color {
		max-width: 260px;
		margin-inline: auto;
	}

	.dh-color-it__sm-btn {
		padding: 6px 12px;
		font-size: 0.8rem;
	}
}
