/*!
 * @Rank – CSS Unit Converter: 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-unit.
 */

.atrank-unit .atrank-unit-panes {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	align-items: start;
}
@media (min-width: 900px) {
	.atrank-unit .atrank-unit-panes {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}
.atrank-unit .atrank-unit-col {
	display: grid;
	gap: 10px;
	min-width: 0;
	align-content: start;
}

.atrank-unit .atrank-cardhead {
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px;
}

/* ── The main value + unit row ────────────────────────────────────────── */
.atrank-unit .atrank-unit-inputrow {
	display: flex;
	gap: 8px;
}
.atrank-unit .atrank-unit-valueinput {
	flex: 1 1 auto;
	min-width: 0;
	font: inherit;
	font-family: var(--mono);
	font-size: 18px;
	font-weight: 700;
	color: var(--accent);
	padding: 8px 11px;
	border: 1px solid var(--line2);
	border-radius: var(--r);
	background: var(--panel);
	box-shadow: var(--field-inset);
}
.atrank-unit .atrank-unit-select {
	flex: 0 0 auto;
	width: 6em;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--txt);
	padding: 8px 9px;
	border: 1px solid var(--line2);
	border-radius: var(--r);
	background: var(--panel);
	box-shadow: var(--field-inset);
}
.atrank-unit .atrank-unit-valueinput:focus-visible,
.atrank-unit .atrank-unit-select:focus-visible {
	outline: none;
	box-shadow: var(--ring);
}

/* ── Context fields ───────────────────────────────────────────────────── */
.atrank-unit .atrank-unit-field {
	display: block;
	margin-top: 10px;
}
.atrank-unit .atrank-unit-field:first-child {
	margin-top: 0;
}
.atrank-unit .atrank-unit-label {
	display: block;
	margin-bottom: 4px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--muted);
}
.atrank-unit .atrank-unit-row2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 10px;
}
.atrank-unit .atrank-unit-row2:first-child {
	margin-top: 0;
}
.atrank-unit .atrank-unit-row2 .atrank-unit-field {
	margin-top: 0;
}
.atrank-unit .atrank-unit-number {
	display: block;
	width: 100%;
	min-width: 0;
	font: inherit;
	font-size: 13px;
	color: var(--txt);
	padding: 6px 9px;
	border: 1px solid var(--line2);
	border-radius: var(--r);
	background: var(--panel);
	box-shadow: var(--field-inset);
}
.atrank-unit .atrank-unit-number:focus-visible {
	outline: none;
	box-shadow: var(--ring);
}

.atrank-unit .atrank-unit-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 10px;
}
.atrank-unit .atrank-unit-preset {
	padding: 4px 10px;
	border: 1px solid var(--line2);
	border-radius: 20px;
	background: var(--panel);
	color: var(--muted);
	font: inherit;
	font-size: 11.5px;
	cursor: pointer;
	transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.atrank-unit .atrank-unit-preset:hover {
	border-color: var(--accent);
	color: var(--accent);
}
.atrank-unit .atrank-unit-preset:focus-visible {
	outline: none;
	box-shadow: var(--ring);
}

/* ── Results ──────────────────────────────────────────────────────────── */
.atrank-unit .atrank-unit-results {
	display: grid;
	gap: 4px;
}
.atrank-unit .atrank-unit-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 9px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--panel2);
}
.atrank-unit .atrank-unit-row.is-source {
	border-color: var(--accent);
	background: var(--accent-soft);
}
.atrank-unit .atrank-unit-rlabel {
	font-size: 12px;
	color: var(--muted);
}
.atrank-unit .atrank-unit-row.is-source .atrank-unit-rlabel {
	color: var(--accent);
	font-weight: 600;
}
.atrank-unit .atrank-unit-rvaluewrap {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}
.atrank-unit .atrank-unit-rvalue {
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 700;
	color: var(--txt);
}
.atrank-unit .atrank-unit-rcopy {
	appearance: none;
	border: 1px solid var(--line2);
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 10.5px;
	padding: 2px 8px;
	border-radius: var(--r);
	cursor: pointer;
}
.atrank-unit .atrank-unit-rcopy:hover {
	color: var(--accent);
	border-color: var(--accent);
	background: var(--hover);
}
.atrank-unit .atrank-unit-rcopy:focus-visible {
	outline: none;
	box-shadow: var(--ring);
}

/* ── Narrow ───────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
	.atrank-unit .atrank-unit-row2 {
		grid-template-columns: 1fr;
	}
	.atrank-unit .atrank-unit-row {
		flex-wrap: wrap;
	}
}
