/* Hash calculator: dual-card input (text | file) + wide output table */

.hash-grid {
    display: grid;
    /* minmax(0, ...): a long digest must scroll inside its table, not widen the page */
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 1024px) {
    .hash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hash-card-wide { grid-column: 1 / -1; }
}







.hash-output-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.hash-source-info {
    flex: 1;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--c-ink-mute);
}

.hash-table { font-size: 0.85rem; }
.hash-table th, .hash-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    vertical-align: top;
}
.hash-table thead { background: var(--c-bg); }

/* Family separator row: subdued header that breaks the table into groups */
.hash-family-head th {
    background: var(--c-bg);
    color: var(--c-ink-mute);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--c-line);
}
.hash-family-head.is-legacy th {
    color: var(--c-orange-600);
}

.hash-algo {
    font-weight: 600;
    color: var(--c-ink);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    width: 140px;
    white-space: nowrap;
}
.hash-algo-name {
    display: inline-block;
}
.hash-legacy-badge {
    margin-left: 0.4rem;
    font-size: 0.62rem;
    text-transform: lowercase;
    vertical-align: middle;
}
.hash-hex {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--c-ink-soft);
    word-break: break-all;
    line-height: 1.5;
}
.hash-len {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--c-ink-mute);
    white-space: nowrap;
    width: 80px;
}
.hash-row-actions { width: 80px; text-align: right; }

/* Pending row state: dimmed cell while the worker is computing this algo */
.hash-row.is-pending .hash-hex {
    color: var(--c-ink-mute);
}
.hash-row.is-error .hash-hex {
    color: var(--c-danger);
}
.hash-pending {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-style: italic;
    color: var(--c-ink-mute);
}
.hash-spin-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 2px solid var(--c-line);
    border-top-color: var(--c-blue);
    animation: hash-spin 0.7s linear infinite;
    flex-shrink: 0;
}
.hash-error {
    color: var(--c-danger);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* Top-right spinner with X/N counter, lives in the output card head */
.hash-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.7rem;
    background: var(--c-blue-50);
    color: var(--c-blue);
    border-radius: var(--r-pill);
    font-size: 0.78rem;
    font-weight: 500;
}
.hash-spinner[hidden] { display: none; }
.hash-spinner-ring {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgb(0 101 192 / 0.25);
    border-top-color: var(--c-blue);
    animation: hash-spin 0.7s linear infinite;
}
.hash-spinner-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

@keyframes hash-spin {
    to { transform: rotate(360deg); }
}

/* While busy, the actions row gets a subdued look */
body.hash-is-busy #hash-btn-process-text,
body.hash-is-busy #hash-btn-export-csv,
body.hash-is-busy #hash-btn-clear {
    opacity: 0.65;
    pointer-events: none;
}

/* Batch verification table. The hash column is the widest thing on the page:
 * a SHA3-512 digest is 128 hex chars, so it wraps instead of forcing the table
 * into a horizontal scroll on every row.
 */
.hash-batch-summary {
    margin: 0 0 var(--s-3);
    font-weight: 600;
}

.hash-batch-hex {
    word-break: break-all;
    font-size: 0.8125rem;
}

.tools-table tr.is-ok td {
    background: color-mix(in srgb, var(--c-success) 8%, transparent);
}

.tools-table tr.is-ko td {
    background: color-mix(in srgb, var(--c-danger) 8%, transparent);
}

/* [hidden] must beat the display set by the component class: .tools-btn-* is
 * inline-flex, which overrides the user-agent rule for the attribute, so a
 * button marked hidden shows up anyway. The natural home for this is
 * public.css, but that bundle sits 14 bytes under the 16 KB gzip budget that
 * gate check 7 enforces, and the rule costs ~40. Repeated here, in the three
 * stylesheets whose tools actually use hidden buttons, until the budget moves.
 */
[hidden] {
    display: none !important;
}
