/* Hash Function Playground (/hash-function-playground): the two messages and their digests with the differences
   marked, the bit grid, the table of every hash function, the avalanche test and the birthday attack. Tiles, panels,
   tables, tags, charts and buttons come from the app kit (css/app-kit, docs/app-kit.md). Loaded only on this app's page
   (StylePaths). */

.hfp-landing-app .hfp-panel { display: flex; flex-direction: column; gap: var(--ak-space-2, 0.6rem); }

.hfp-landing-app .hfp-title { margin: 0; font-size: var(--ak-fs-md, 1rem); font-weight: 700; }

.hfp-landing-app .hfp-compare {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.25rem 0.75rem;
    align-items: baseline;
    margin: 0;
}

.hfp-landing-app .hfp-compare dt { font-weight: 700; font-size: var(--ak-fs-sm, 0.9rem); }
.hfp-landing-app .hfp-compare dt.hfp-digest-label { font-weight: 500; color: var(--ak-muted); font-size: var(--ak-fs-xs, 0.78rem); }
.hfp-landing-app .hfp-compare dd { margin: 0; }
.hfp-landing-app .hfp-compare dd.hfp-hex { margin-bottom: 0.45rem; }

.hfp-landing-app .hfp-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.hfp-landing-app .hfp-hex,
.hfp-landing-app .hfp-pair-msg {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--ak-fs-sm, 0.88rem);
    overflow-wrap: anywhere;
    word-break: break-all;
}

.hfp-landing-app .hfp-mark {
    padding: 0 0.05em;
    border-radius: 3px;
    background: color-mix(in srgb, var(--ak-danger) 22%, transparent);
    color: inherit;
    font-weight: 700;
}

/* In the digests nearly every digit differs: those are coloured, the few that stay the same are plain. */
.hfp-landing-app .hfp-hex .hfp-mark { padding: 0; background: none; color: var(--ak-danger); font-weight: 600; }

.hfp-landing-app .hfp-grid {
    --hfp-cols: 16;
    display: grid;
    grid-template-columns: repeat(var(--hfp-cols), minmax(0, 1fr));
    gap: 2px;
    max-width: calc(var(--hfp-cols) * 1.15rem);
}

.hfp-landing-app .hfp-bit,
.hfp-landing-app .hfp-swatch {
    aspect-ratio: 1;
    border-radius: 2px;
    background: color-mix(in srgb, var(--ak-muted) 18%, var(--ak-field));
}

.hfp-landing-app .hfp-bit.is-one,
.hfp-landing-app .hfp-swatch.is-one { background: color-mix(in srgb, var(--ak-muted) 50%, var(--ak-field)); }

.hfp-landing-app .hfp-bit.is-flipped,
.hfp-landing-app .hfp-swatch.is-flipped { background: var(--ak-danger); }

.hfp-landing-app .hfp-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: var(--ak-fs-xs, 0.78rem); color: var(--ak-muted); }
.hfp-landing-app .hfp-legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.hfp-landing-app .hfp-swatch { display: inline-block; width: 0.8rem; }

.hfp-landing-app .hfp-algs tbody tr { cursor: pointer; }
.hfp-landing-app .hfp-algs tbody th { font-weight: 600; white-space: nowrap; }
.hfp-landing-app .hfp-algs .hfp-hex { font-size: var(--ak-fs-xs, 0.78rem); min-width: 10rem; white-space: normal; word-break: break-all; }
.hfp-landing-app .hfp-algs td:last-child { white-space: nowrap; }

.hfp-landing-app .hfp-pairs { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.hfp-landing-app .hfp-pairs:empty { display: none; }
.hfp-landing-app .hfp-pair {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius, 10px);
    background: var(--ak-field);
}
.hfp-landing-app .hfp-pair-msg { font-weight: 700; }
.hfp-landing-app .hfp-match {
    padding: 0 0.1em;
    border-radius: 3px;
    background: color-mix(in srgb, var(--ak-success) 24%, transparent);
    color: inherit;
    font-weight: 700;
}

.hfp-landing-app .hfp-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }

.hfp-landing-app .hfp-actions { display: flex; flex-wrap: wrap; gap: var(--ak-space-2, 0.5rem); }
