/*!
 * @Rank – Hash & Checksum Generator: 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-hash.
 *
 * Two rules here are function rather than decoration:
 *   · a digest is set in the monospace face and allowed to break anywhere — a
 *     SHA-512 is 128 unbroken characters and would otherwise push the column
 *     sideways;
 *   · the "not for security" mark is amber and sits ON the row, not in a
 *     tooltip. A caveat somebody has to hover to find is a caveat nobody reads.
 */

.atrank-hash .atrank-hash-panes {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	align-items: start;
}
@media (min-width: 940px) {
	.atrank-hash .atrank-hash-panes {
		grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
	}
}

.atrank-hash .atrank-hash-pane {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.atrank-hash .atrank-cardhead {
	justify-content: space-between;
	flex-wrap: wrap;
}
.atrank-hash .atrank-cardhead h2 {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--accent);
}

.atrank-hash .atrank-hash-area {
	display: block;
	width: 100%;
	min-width: 0;
	min-height: min(150px, max(96px, 16vh));
	max-height: 40vh;
	resize: vertical;
	padding: 9px 11px;
	border: 1px solid var(--line2);
	border-radius: var(--r);
	background: var(--inset);
	color: var(--txt);
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.55;
}
.atrank-hash .atrank-hash-area:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: var(--ring);
}

/* ── The file area ────────────────────────────────────────────────────── */
.atrank-hash .atrank-hash-drop {
	display: grid;
	place-items: center;
	gap: 2px;
	text-align: center;
	margin-top: 9px;
	padding: 11px;
	border: 2px dashed var(--line2);
	border-radius: var(--r-lg);
	background: var(--panel2);
	cursor: pointer;
	transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.atrank-hash .atrank-hash-drop:hover,
.atrank-hash .atrank-hash-drop.is-over {
	border-color: var(--accent);
	background: var(--accent-soft);
}
.atrank-hash .atrank-hash-drop:focus-within {
	outline: none;
	box-shadow: var(--ring);
}
.atrank-hash .atrank-hash-droptitle {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--accent);
}
.atrank-hash .atrank-hash-filename:not(:empty) {
	margin-top: 4px;
	padding: 1px 8px;
	border-radius: var(--r);
	background: var(--accent);
	color: var(--on-accent);
	font-family: var(--mono);
	font-size: 11.5px;
	overflow-wrap: anywhere;
}

/* ── Comparing ────────────────────────────────────────────────────────── */
.atrank-hash .atrank-hash-field {
	display: block;
	margin-top: 10px;
}
.atrank-hash .atrank-hash-label {
	display: block;
	margin-bottom: 3px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--dim);
}
.atrank-hash .atrank-hash-input {
	display: block;
	width: 100%;
	min-width: 0;
	padding: 6px 9px;
	border: 1px solid var(--line2);
	border-radius: var(--r);
	background: var(--panel);
	color: var(--txt);
	font-family: var(--mono);
	font-size: 12.5px;
}
.atrank-hash .atrank-hash-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: var(--ring);
}

.atrank-hash .atrank-hash-verdict:not(:empty) {
	margin-top: 7px;
	padding: 6px 9px;
	border-radius: var(--r);
	border: 1px solid var(--line);
	background: var(--panel2);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.45;
}
.atrank-hash .atrank-hash-verdict.is-ok {
	background: var(--ok-soft);
	border-color: var(--ok);
	color: var(--ok);
}
.atrank-hash .atrank-hash-verdict.is-err {
	background: var(--err-soft);
	border-color: var(--err);
	color: var(--err);
}

/* ── The digests ──────────────────────────────────────────────────────── */
.atrank-hash .atrank-hash-rows {
	display: grid;
	gap: 7px;
}

.atrank-hash .atrank-hash-row {
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--panel2);
	min-width: 0;
}
/* The row the pasted checksum belongs to, so the answer is where the eye is. */
.atrank-hash .atrank-hash-row.is-matched {
	border-color: var(--ok);
	background: var(--ok-soft);
}
.atrank-hash .atrank-hash-row.is-mismatched {
	border-color: var(--err);
	background: var(--err-soft);
}

.atrank-hash .atrank-hash-rowhead {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 3px;
}

.atrank-hash .atrank-hash-alg {
	font-size: 11.5px;
	font-weight: 700;
	color: var(--accent);
	letter-spacing: 0.02em;
}

/* On the row, not in a tooltip: a caveat somebody has to hover to find is a
   caveat nobody reads. */
.atrank-hash .atrank-hash-broken {
	padding: 0 6px;
	border-radius: var(--r);
	background: var(--warn-soft);
	color: var(--warn);
	font-size: 10.5px;
	font-weight: 700;
	white-space: nowrap;
	cursor: help;
}

.atrank-hash .atrank-hash-copy {
	margin-left: auto;
	flex: 0 0 auto;
	padding: 3px 9px;
	font-size: 11.5px;
}

/* A SHA-512 is 128 unbroken characters. */
.atrank-hash .atrank-hash-value {
	display: block;
	font-family: var(--mono);
	font-size: 12px;
	line-height: 1.5;
	color: var(--txt);
	overflow-wrap: anywhere;
	word-break: break-all;
}
.atrank-hash .atrank-hash-value.is-missing {
	color: var(--dim);
	font-style: italic;
}

.atrank-hash .atrank-hash-sri {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 3px 7px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--inset);
	color: var(--dim);
	font-family: var(--mono);
	font-size: 11px;
	line-height: 1.45;
	text-align: left;
	cursor: pointer;
	overflow-wrap: anywhere;
	word-break: break-all;
}
.atrank-hash .atrank-hash-sri:hover {
	color: var(--accent);
	border-color: var(--accent);
}
.atrank-hash .atrank-hash-sri:focus-visible {
	outline: none;
	box-shadow: var(--ring);
}
