/*!
 * @Rank – Image Compressor & Resizer: the tool's own rules.
 *
 * The palette, header, cards, buttons, notices and toast all come from
 * assets/css/atrank-core.css. Only what is specific to this tool is here, and
 * every rule is anchored on .atrank-img — a bare .atrank-something would reach
 * the host page, and the harness fails on it.
 *
 * Two rules here are function rather than decoration:
 *   · the thumbnail sits on a checkerboard, because a transparent PNG on a
 *     white card looks exactly like an opaque white one, and whether the
 *     transparency survived is the thing somebody is checking;
 *   · the drop area keeps its height whether or not anything is in it, so the
 *     page does not jump under the pointer mid-drag.
 */

.atrank-img .atrank-img-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
}

.atrank-img .atrank-img-group {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.atrank-img .atrank-img-glabel {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--dim);
	white-space: nowrap;
}

.atrank-img .atrank-img-times {
	color: var(--dim);
	font-size: 12.5px;
}

.atrank-img .atrank-img-select {
	font: inherit;
	font-size: 12.5px;
	padding: 5px 8px;
	border-radius: var(--r);
	border: 1px solid var(--line2);
	background: var(--panel);
	color: var(--txt);
}

/* Sized for five digits, and without the spinner arrows: nobody nudges a
   pixel limit from 1600 to 1599. */
.atrank-img .atrank-img-number {
	width: 7ch;
	text-align: center;
	font: inherit;
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
	padding: 5px 6px;
	border-radius: var(--r);
	border: 1px solid var(--line2);
	background: var(--panel);
	color: var(--txt);
	appearance: textfield;
	-moz-appearance: textfield;
}
.atrank-img .atrank-img-number::-webkit-outer-spin-button,
.atrank-img .atrank-img-number::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}

.atrank-img .atrank-img-select:focus-visible,
.atrank-img .atrank-img-number:focus-visible {
	outline: none;
	box-shadow: var(--ring);
	border-color: var(--accent);
}

.atrank-img .atrank-img-range {
	width: 130px;
	accent-color: var(--accent);
}
.atrank-img .atrank-img-out {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--accent);
	font-variant-numeric: tabular-nums;
	min-width: 4ch;
}

.atrank-img .atrank-img-check {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12.5px;
	color: var(--muted);
	cursor: pointer;
}
.atrank-img .atrank-img-check input {
	width: 15px;
	height: 15px;
	accent-color: var(--accent);
}

/* ── The drop area ────────────────────────────────────────────────────── */
.atrank-img .atrank-img-pane {
	margin-top: 10px;
}

.atrank-img .atrank-cardhead {
	justify-content: space-between;
	flex-wrap: wrap;
}
.atrank-img .atrank-cardhead h2 {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--accent);
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.atrank-img .atrank-img-drop {
	display: grid;
	place-items: center;
	gap: 3px;
	text-align: center;
	min-height: 92px;
	padding: 14px;
	border: 2px dashed var(--line2);
	border-radius: var(--r-lg);
	background: var(--inset);
	cursor: pointer;
	transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.atrank-img .atrank-img-drop:hover,
.atrank-img .atrank-img-drop.is-over {
	border-color: var(--accent);
	background: var(--accent-soft);
}
.atrank-img .atrank-img-drop:focus-within {
	outline: none;
	box-shadow: var(--ring);
}
.atrank-img .atrank-img-droptitle {
	font-size: 13px;
	font-weight: 700;
	color: var(--accent);
}

/* ── The results ──────────────────────────────────────────────────────── */
.atrank-img .atrank-img-rows {
	display: grid;
	gap: 8px;
	margin-top: 10px;
}

.atrank-img .atrank-img-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: start;
	gap: 10px;
	padding: 9px 10px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--panel2);
}

/* A checkerboard, because a transparent PNG on a white card is
   indistinguishable from an opaque white one — and whether the transparency
   survived is exactly what somebody is looking for. */
.atrank-img .atrank-img-thumb {
	width: 56px;
	height: 56px;
	object-fit: contain;
	border-radius: var(--r);
	border: 1px solid var(--line);
	background:
		repeating-conic-gradient(#e6e6ea 0% 25%, #f6f6f8 0% 50%) 0 0/12px 12px;
}

.atrank-img .atrank-img-body {
	min-width: 0;
}

.atrank-img .atrank-img-name {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--txt);
	overflow-wrap: anywhere;
}

.atrank-img .atrank-img-facts {
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--muted);
	margin-top: 2px;
	overflow-wrap: anywhere;
}

.atrank-img .atrank-img-badge {
	display: inline-block;
	margin-top: 4px;
	padding: 1px 7px;
	border-radius: var(--r);
	font-size: 11px;
	font-weight: 700;
}
.atrank-img .atrank-img-badge.is-smaller {
	background: var(--ok-soft);
	color: var(--ok);
}
/* Bigger is not a failure, but it is the thing to notice. */
.atrank-img .atrank-img-badge.is-bigger {
	background: var(--err-soft);
	color: var(--err);
}

.atrank-img .atrank-img-save {
	flex: 0 0 auto;
	align-self: center;
}

.atrank-img .atrank-img-notes {
	margin: 6px 0 0;
	padding: 0 0 0 15px;
	display: grid;
	gap: 3px;
}
.atrank-img .atrank-img-notes li {
	font-size: 11.5px;
	line-height: 1.45;
	color: var(--muted);
}
.atrank-img .atrank-img-notes li.is-bigger {
	color: var(--err);
}
.atrank-img .atrank-img-notes li.is-alpha,
.atrank-img .atrank-img-notes li.is-format,
.atrank-img .atrank-img-notes li.is-animated,
.atrank-img .atrank-img-notes li.is-upscale {
	color: var(--warn);
}

@media (max-width: 600px) {
	.atrank-img .atrank-img-row {
		grid-template-columns: auto minmax(0, 1fr);
	}
	.atrank-img .atrank-img-save {
		grid-column: 1 / -1;
		justify-content: center;
	}
}
