/* ---------- WebP converter [webp_converter] ---------- */

.hat .hat-wc {
	display: grid;
	gap: 18px;
}

.hat .hat-wc-drop {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 6px;
	margin: 0;
	padding: 34px 20px;
	text-align: center;
	border: 2px dashed #b8c7d6;
	border-radius: var(--hat-radius-lg);
	background: var(--hat-surface-2);
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s, transform 0.15s var(--hat-ease);
}

.hat .hat-wc-drop:hover,
.hat .hat-wc-drop.is-over {
	border-color: var(--hat-primary);
	background: var(--hat-primary-soft);
}

.hat .hat-wc-drop.is-over {
	transform: scale(1.01);
}

.hat .hat-wc-drop:focus-within {
	outline: 3px solid rgba(40, 114, 250, 0.45);
	outline-offset: 2px;
}

.hat .hat-wc-drop.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.hat .hat-wc-drop-icon {
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--hat-white);
	color: var(--hat-primary);
	box-shadow: var(--hat-shadow);
}

.hat .hat-wc-drop-icon .hat-icon {
	width: 28px;
	height: 28px;
}

.hat .hat-wc-drop-title {
	font-size: 1.15rem;
	color: var(--hat-heading);
}

.hat .hat-wc-drop-link {
	color: var(--hat-primary);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hat .hat-wc-drop-hint {
	font-size: 0.82rem;
	opacity: 0.85;
}

/* Options */
.hat .hat-wc-opts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 16px 20px;
	align-items: start;
	padding: 18px;
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius);
}

.hat .hat-wc-opts .hat-field {
	gap: 8px;
}

.hat .hat-wc-format .hat-chip span {
	min-width: 64px;
	justify-content: center;
}

.hat .hat-chip.is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.hat .hat-wc-q-val {
	display: inline-block;
	min-width: 2.2em;
	margin-inline-start: 6px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--hat-primary-soft);
	color: var(--hat-primary-dark);
	text-align: center;
	font-size: 0.85rem;
}

.hat .hat-wc-range {
	width: 100%;
	margin: 6px 0 0;
	accent-color: var(--hat-primary);
	cursor: pointer;
}

.hat .hat-wc-range:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.hat .hat-wc-q-hint {
	font-size: 0.8rem;
	opacity: 0.85;
}

.hat .hat-wc-check {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	align-self: center;
	font-weight: 700;
	font-size: 0.92rem;
	color: var(--hat-heading);
	cursor: pointer;
}

.hat .hat-wc-check input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--hat-primary);
}

.hat .hat-wc-check small {
	font-weight: 400;
	opacity: 0.8;
}

.hat .hat-wc-check.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.hat .hat-wc-privacy {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--hat-success);
	text-align: center;
}

.hat .hat-wc-msg:empty {
	display: none;
}

/* Summary bar */
.hat .hat-wc-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-radius: var(--hat-radius);
	background: var(--hat-surface);
}

.hat .hat-wc-total {
	margin: 0;
	font-weight: 700;
	color: var(--hat-heading);
}

.hat .hat-wc-progress::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-inline-end: 8px;
	vertical-align: -2px;
	border: 2px solid var(--hat-border);
	border-top-color: var(--hat-primary);
	border-radius: 50%;
	animation: hat-spin 0.7s linear infinite;
}

/* File rows */
.hat .hat-wc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.hat .hat-wc-list:empty {
	display: none;
}

.hat .hat-wc-item {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	padding: 10px 12px;
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius);
	background: var(--hat-white);
	animation: hat-rise 0.3s var(--hat-ease) both;
}

.hat .hat-wc-item.is-error {
	border-color: rgba(224, 45, 60, 0.35);
}

.hat .hat-wc-thumb {
	flex: none;
	width: 64px;
	height: 64px;
	display: grid;
	place-items: center;
	overflow: hidden;
	border-radius: 10px;
	color: #9aabbd;
	/* Checkerboard shows transparency */
	background: #fff repeating-conic-gradient(#eef2f6 0% 25%, #fff 0% 50%) 50% / 14px 14px;
}

.hat .hat-wc-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hat .hat-wc-item.is-working .hat-wc-thumb .hat-icon {
	animation: hat-fade 0.8s ease-in-out infinite alternate;
}

.hat .hat-wc-info {
	flex: 1;
	min-width: 0;
	display: grid;
	gap: 4px;
}

.hat .hat-wc-name {
	font-weight: 700;
	color: var(--hat-heading);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hat .hat-wc-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	font-size: 0.88rem;
}

.hat .hat-wc-old {
	text-decoration: line-through;
	opacity: 0.7;
}

.hat .hat-wc-total bdi,
.hat .hat-wc-sizes,
.hat .hat-wc-dims {
	white-space: nowrap;
}

.hat .hat-wc-sizes strong {
	color: var(--hat-heading);
}

.hat .hat-wc-dims {
	opacity: 0.8;
}

.hat .hat-wc-wait {
	color: var(--hat-primary);
	font-weight: 700;
}

.hat .hat-wc-note {
	font-size: 0.82rem;
}

.hat .hat-wc-note:empty {
	display: none;
}

.hat .hat-wc-note.is-warn { color: var(--hat-warn); }
.hat .hat-wc-note.is-bad { color: var(--hat-danger); }

.hat .hat-wc-actions {
	flex: none;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hat .hat-wc-dl[aria-disabled="true"] {
	opacity: 0.45;
	pointer-events: none;
}

.hat .hat-wc-why {
	margin: 0;
	text-align: center;
}

@media (max-width: 640px) {
	.hat .hat-wc-drop {
		padding: 26px 14px;
	}

	.hat .hat-wc-opts {
		grid-template-columns: 1fr;
		padding: 14px;
	}

	.hat .hat-wc-bar .hat-actions,
	.hat .hat-wc-bar .hat-btn {
		width: 100%;
	}

	.hat .hat-wc-item {
		flex-wrap: wrap;
		gap: 10px 12px;
	}

	.hat .hat-wc-thumb {
		width: 56px;
		height: 56px;
	}

	.hat .hat-wc-actions {
		width: 100%;
	}

	.hat .hat-wc-dl {
		flex: 1;
	}
}
