/* Reserve the slot below the button on phones and in the second column on desktop. */
.cf-on, .cf-input, .cf-on .validator-form > * { min-width: 0; }

.cf-on .validator-form { grid-template-columns: minmax(0, 1fr); }
.cf-on .cf-slot { position: relative; min-height: 440px; }

@media (min-width: 981px) {
    .validator-page.cf-page { width: min(1240px, calc(100% - 32px)); }
    .cf-page .validator-shell { grid-template-columns: minmax(0, 1fr); }
    .cf-page .validator-shell > :not(.cf-on) { width: min(900px, 100%); min-width: 0; justify-self: center; }
    .cf-on {
        --cf-pad: clamp(24px, 2.5vw, 34px);
        position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center; gap: 24px; padding: var(--cf-pad); min-height: calc(442px + 2 * var(--cf-pad));
    }
    .cf-on .cf-slot { position: absolute; inset: var(--cf-pad) var(--cf-pad) var(--cf-pad) calc(50% + 12px); }
    .cf-on .validator-heading, .cf-on .validator-heading > p, .cf-on #list-status { text-align: left; }
    .cf-on .validator-proof { justify-content: flex-start; }
    .cf-on .validator-form, .cf-on .primary-btn { margin-left: 0; }
    .cf-page .cf-on h1 { font-size: clamp(2.4rem, 4vw, 4.25rem); overflow-wrap: anywhere; }
}

@media (max-width: 980px) {
    .cf-on .validator-form { min-width: 0; }
    .cf-on .cf-slot { min-height: 200px; height: 218px; }
}

/* Absolute chrome keeps the reserved slot stable across scenes. */
.cf-film {
    --cf-green: #31e274; --cf-light: #89f7a9; --cf-cyan: #79d9ff; --cf-amber: #f2cc5d; --cf-red: #ff4d6d;
    --cf-ink: #f5f7f6; --cf-muted: #9fb0a7; --cf-line: rgba(148, 163, 184, .22);
    --cf-mono: "JetBrains Mono", ui-monospace, monospace; --cf-bounce: cubic-bezier(.2, 1.4, .4, 1); position: absolute;
    inset: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(80, 235, 139, .32);
    border-radius: 14px;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(49, 226, 116, .16), transparent 55%),
        radial-gradient(90% 70% at 100% 100%, rgba(49, 226, 116, .08), transparent 60%),
        linear-gradient(180deg, rgba(10, 26, 19, .96), rgba(4, 12, 9, .98));
    box-shadow: 0 30px 90px #0008; color: var(--cf-ink);
    font: 700 12px/1.3 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; text-align: left;
    user-select: none; pointer-events: none;
}

.cf-film * { box-sizing: border-box; }
.cf-film i, .cf-film em { font-style: normal; }
.cf-top, .cf-dots, .cf-live { display: flex; align-items: center; }
.cf-top { flex: 0 0 40px; gap: 9px; padding: 0 12px; border-bottom: 1px solid var(--cf-line); }
.cf-dots { flex: none; gap: 4px; }
.cf-dots i, .cf-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--cf-green); }
.cf-dots i:first-child { background: var(--cf-red); }
.cf-dots i:nth-child(2) { background: var(--cf-amber); }
.cf-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 11px/1 var(--cf-mono); }
.cf-upload, .cf-step em { overflow: hidden; background: rgba(255, 255, 255, .08); border-radius: 4px; }
.cf-upload { flex: 1; min-width: 14px; height: 3px; }
.cf-upload i, .cf-step em i {
    display: block; height: 100%; background: linear-gradient(90deg, var(--cf-green), var(--cf-cyan));
    transform-origin: left;
}
.cf-tag { padding: 3px 5px; border-radius: 4px; background: #f2cc5d26; color: var(--cf-amber); font-size: 9px; }
.cf-live { gap: 4px; color: var(--cf-light); font: 700 9px/1 var(--cf-mono); }
.cf-live i { width: 5px; height: 5px; box-shadow: 0 0 10px var(--cf-green); animation: cf-pulse 1.15s ease-in-out infinite; }

.cf-steps { display: flex; flex: 0 0 38px; gap: 8px; padding: 5px 12px; border-top: 1px solid var(--cf-line); }
.cf-step { display: grid; flex: 1 1 0; min-width: 0; gap: 4px; align-content: center; color: var(--cf-muted); font-size: 10px; }
.cf-step > span { display: flex; align-items: center; gap: 4px; }
.cf-step > span i {
    display: grid; place-items: center; width: 14px; height: 14px; border: 1px solid var(--cf-line); border-radius: 50%;
    font: 700 9px/1 var(--cf-mono);
}
.cf-step em { height: 2px; }
.cf-step.is-active, .cf-step.is-done { color: var(--cf-light); }
.cf-step.is-active > span i { color: #04130b; background: var(--cf-green); }
.cf-footer { flex: none; padding: 4px 12px 6px; color: var(--cf-muted); font-size: 10px; }

/* Stage effects. */
.cf-stage { isolation: isolate; position: relative; flex: 1; min-height: 0; overflow: hidden; }
.cf-stage::before {
    content: ""; position: absolute; inset: -20px; z-index: -1;
    background: radial-gradient(circle, rgba(121, 217, 255, .095) 1px, transparent 1.25px) 0 0 / 20px 20px;
    animation: cf-drift 5s linear infinite;
}
.cf-content { display: grid; grid-template-columns: minmax(0, 1fr); place-content: center stretch; gap: 8px; height: 100%; padding: 10px 14px; }
.cf-label { color: var(--cf-muted); font: 700 10px/1.3 var(--cf-mono); }
.cf-wipe.is-sweeping {
    position: absolute; inset: -12% 0; z-index: 3;
    background: linear-gradient(90deg, transparent 25%, #31e27426 52%, #89f7a994 56%, transparent 58%);
    animation: cf-wipe 380ms cubic-bezier(.6, 0, .25, 1) both;
}

.cf-chase {
    position: absolute; inset: 0; z-index: 4; padding: 2px; border-radius: inherit; overflow: hidden;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask-composite: exclude; display: none;
}
.cf-film.is-processing .cf-chase { display: block; }
.cf-chase::after {
    content: ""; position: absolute; inset: -80%;
    background: conic-gradient(transparent 25%, var(--cf-green), var(--cf-cyan) 48%, transparent 51%, transparent 78%, var(--cf-green), transparent);
    animation: cf-orbit 1.25s linear infinite;
}
.cf-film.is-error { animation: cf-shake 250ms steps(1, end); }
.cf-film.is-error::after {
    content: ""; position: absolute; inset: 0; z-index: 5; border: 2px solid var(--cf-red); border-radius: inherit;
    box-shadow: inset 0 0 38px #ff4d6d88; animation: cf-fade 250ms ease-out both;
}
.cf-film.is-error .cf-row.is-invalid .cf-status { animation: cf-glitch 250ms steps(1, end); }

/* Pasted and scanned rows. */
.cf-list { position: relative; }
.cf-list, .cf-results { display: grid; gap: 5px; min-width: 0; }
.cf-row, .cf-work, .cf-result { border: 1px solid var(--cf-line); border-radius: 6px; background: #020806aa; }
.cf-row {
    display: flex; align-items: center; min-width: 0; min-height: 31px; gap: 7px; padding: 0 8px;
    font: 700 12px/1 var(--cf-mono); opacity: 0;
}
.cf-row.is-in { opacity: 1; }
.cf-row.is-typing { animation: cf-in 260ms var(--cf-bounce) both; }
.cf-row.is-reading { border-color: var(--cf-cyan); }
.cf-row.is-valid, .cf-result { border-color: #31e27455; }
.cf-row.is-invalid, .cf-result-bad { border-color: #ff4d6d99; background: #ff4d6d1e; }
.cf-film .cf-flag { flex: none; width: auto; font: 13px/1 system-ui, sans-serif; background-image: none; }
.cf-film .cf-flag::before { content: none; }
.cf-value { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.cf-status { flex: none; margin-left: auto; color: var(--cf-muted); font-size: .78em; white-space: nowrap; }
.cf-row.is-valid .cf-status, .cf-badge { color: var(--cf-light); }
.cf-row.is-invalid .cf-status { color: var(--cf-red); }
.cf-status b, .cf-ring { position: relative; }
.cf-row.is-valid .cf-status b::after, .cf-ring.is-lit::after {
    content: ""; position: absolute; inset: -3px; border: 1px solid var(--cf-cyan); border-radius: 50%;
    animation: cf-wave 480ms ease-out both;
}
.cf-beam { position: absolute; inset: 0; overflow: hidden; }
.cf-film.is-processing .cf-beam::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(transparent 79%, #31e27430 98%, #a8ffca 99%, transparent);
    filter: drop-shadow(0 0 5px var(--cf-green)); animation: cf-scan var(--cf-scan-time) linear both;
}

.cf-digit, .cf-letter { display: inline-block; opacity: 0; }
.cf-digit { vertical-align: top; }
.cf-reel { display: block; height: 1em; overflow: hidden; }
.cf-reel span, .cf-reel i { display: block; }
.cf-row.is-typing .cf-digit, .cf-row.is-typing .cf-letter {
    animation: cf-digit 300ms var(--cf-bounce) var(--cf-delay) both;
}
.cf-row.is-typing .cf-reel span { animation: cf-spin 260ms cubic-bezier(.25, .74, .31, 1) var(--cf-delay) both; }

/* The calculation tray shows the reordered IBAN or weighted ABA digits. */
.cf-work {
    display: grid; align-content: center; gap: 4px; min-height: 60px; padding: 5px 9px;
    color: var(--cf-cyan); font: 700 12px/1.25 var(--cf-mono);
}
.cf-work-label { color: var(--cf-muted); font-size: .85em; }
.cf-rotate, .cf-numeric { grid-area: 1 / 1; white-space: nowrap; }
.cf-rotate { animation: cf-old 530ms linear both; }
.cf-rotate i, .cf-rotate b { display: inline-block; }
.cf-rotate i { color: var(--cf-light); animation: cf-prefix 330ms ease 110ms both; }
.cf-rotate b { color: var(--cf-ink); animation: cf-bban 330ms ease 110ms both; }
.cf-numeric { color: var(--cf-ink); animation: cf-in 140ms ease-out 480ms both; }
.cf-morph { display: inline-grid; color: var(--cf-cyan); }
.cf-morph i, .cf-morph b { grid-area: 1 / 1; }
.cf-morph i { animation: cf-letter-out 210ms ease-in 490ms both; }
.cf-morph b { animation: cf-letter-in 250ms var(--cf-bounce) 510ms both; }
.cf-rotate ~ .cf-work-label { animation: cf-in 180ms ease-out 620ms both; }

.cf-factors { display: grid; grid-template-columns: repeat(9, minmax(0, 30px)); gap: 4px; text-align: center; }
.cf-factor { display: grid; }
.cf-factor small, .cf-factor i { font-size: 9px; }
.cf-factor small { color: var(--cf-amber); }
.cf-factor b { background: #79d9ff22; color: var(--cf-ink); animation: cf-digit 330ms ease-out var(--cf-delay) both; }
.cf-factor i { animation: cf-in 250ms var(--cf-bounce) calc(280ms + var(--cf-delay)) both; }
.cf-sum { color: var(--cf-cyan); }

/* Result cards, evidence and the copy frame. */
.cf-result { display: grid; gap: 3px; min-width: 0; padding: 4px 7px; }
.cf-result-id, .cf-bank, .cf-bank-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cf-result-id { font: 700 11px/1.1 var(--cf-mono); white-space: nowrap; }
.cf-badge { margin-left: auto; }
.cf-bank { justify-content: space-between; }
.cf-bank-name { white-space: nowrap; font-size: 11px; }
.cf-bank-name b { overflow: hidden; text-overflow: ellipsis; }
.cf-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.cf-bank-name img { width: 18px; height: 15px; object-fit: contain; padding: 1px; border-radius: 3px; background: #edf6f0; }
.cf-results-aba .cf-bank-name img { width: 104px; height: 19px; padding: 2px 5px; }
.cf-results-aba .cf-bank-name img:not([hidden]) + b { display: none; }
.cf-result-error { color: var(--cf-red); font-size: 10px; }
.cf-chip {
    padding: 2px 6px; border: 1px solid #79d9ff44; border-radius: 999px; color: var(--cf-cyan);
    white-space: nowrap; font: 700 10px/1.15 var(--cf-mono);
}
.cf-pop { animation: cf-in 330ms var(--cf-bounce) var(--cf-delay, 0ms) both; }
.cf-summary { display: flex; align-items: center; justify-content: center; gap: 10px; }
.cf-ring, .cf-copy-mark {
    display: grid; place-items: center; flex: none; width: 47px; height: 47px; border: 2px solid var(--cf-green);
    border-radius: 50%; background: #31e27420; box-shadow: 0 0 22px #31e27444;
    color: var(--cf-light); font: 800 25px/1 var(--cf-mono);
}
.cf-summary-value { font: 800 16px/1.2 var(--cf-mono); }
.cf-copy { display: grid; justify-items: center; align-content: center; gap: 14px; text-align: center; }
.cf-copy-mark { width: 62px; height: 62px; }
.cf-copy-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.cf-film .is-lit { animation: cf-digit 340ms var(--cf-bounce) both; }
.cf-copied, .cf-copy-value { min-height: 1.3em; color: var(--cf-light); font: 700 11px/1.3 var(--cf-mono); }
.cf-particle {
    position: absolute; top: 50%; left: 50%; z-index: 2; width: 3px; height: 3px; border-radius: 50%;
    background: var(--cf-green); animation: cf-particle 530ms ease-out both;
}
.cf-particle:nth-child(odd) { background: var(--cf-cyan); }

@keyframes cf-pulse { 50% { opacity: .45; transform: scale(.66); } }
@keyframes cf-drift { to { transform: translate(20px, 20px); } }
@keyframes cf-wipe { from { transform: translateX(-100%) skewX(-17deg); } to { transform: translateX(100%) skewX(-17deg); } }
@keyframes cf-orbit { to { transform: rotate(1turn); } }
@keyframes cf-fade { to { opacity: 0; } }
@keyframes cf-shake { 20% { transform: translateX(-4px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }
@keyframes cf-glitch {
    0%, 75% { transform: translateX(2px); text-shadow: 2px 0 #ff4d6d, -2px 0 #79d9ff; }
    25% { transform: translateX(-3px); filter: brightness(1.4); }
    50% { transform: translateX(3px); }
}
@keyframes cf-in { from { opacity: 0; transform: translate(-8px, 3px) scale(.94); } }
@keyframes cf-scan { from { transform: translateY(-100%); } to { transform: translateY(2%); } }
@keyframes cf-wave { from { opacity: .9; transform: scale(.65); } to { opacity: 0; transform: scale(2.05); } }
@keyframes cf-particle { from { opacity: 1; } to { opacity: 0; transform: translate(var(--cf-x), var(--cf-y)) scale(.4); } }
@keyframes cf-digit {
    0% { opacity: 0; transform: scale(.8); }
    74% { opacity: 1; }
    87% { transform: scale(1.15); filter: drop-shadow(0 0 4px var(--cf-cyan)); }
    100% { opacity: 1; transform: none; }
}
@keyframes cf-spin {
    0%, 55% { filter: blur(1.5px); }
    0% { transform: translateY(0); }
    100% { transform: translateY(var(--cf-stop)); filter: none; }
}
@keyframes cf-prefix { to { transform: translateX(var(--cf-body)); } }
@keyframes cf-bban { to { transform: translateX(-4ch); } }
@keyframes cf-old { 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cf-letter-out { to { opacity: 0; transform: translateY(-.5em); } }
@keyframes cf-letter-in { from { opacity: 0; transform: translateY(.5em); } }

@media (max-width: 980px) {
    .cf-top { flex-basis: 26px; padding: 0 7px; gap: 5px; }
    .cf-dots { gap: 3px; }
    .cf-dots i { width: 4px; height: 4px; }
    .cf-file, .cf-label { font-size: 9px; }
    .cf-tag, .cf-live, .cf-footer { font-size: 8px; }
    .cf-steps { flex-basis: 25px; padding: 3px 7px; gap: 5px; }
    .cf-step { font-size: 9px; gap: 2px; }
    .cf-step > span i { width: 12px; height: 12px; font-size: 8px; }
    .cf-footer { padding: 2px 7px 4px; }
    .cf-content { gap: 3px; padding: 4px 7px; }
    .cf-list, .cf-results { gap: 2px; }
    .cf-row { min-height: 16px; gap: 4px; padding: 0 4px; font-size: 9px; }
    .cf-film .cf-flag { font-size: 10px; }
    .cf-work { min-height: 28px; padding: 2px 4px; gap: 1px; font-size: 9px; }
    .cf-factor small, .cf-factor i { font-size: 8px; }
    .cf-result { gap: 2px; padding: 2px 4px; min-height: 17px; }
    .cf-results-iban .cf-result:not(.cf-result-bad) .cf-result-id { display: none; }
    .cf-results .cf-result-bad { display: flex; align-items: center; justify-content: space-between; }
    .cf-result-id, .cf-bank-name, .cf-chip, .cf-result-error { font-size: 9px; }
    .cf-bank-name img { width: 13px; height: 11px; }
    .cf-results-aba .cf-bank-name img { width: 90px; height: 17px; }
    .cf-chip { padding: 1px 4px; }
    .cf-ring { width: 26px; height: 26px; font-size: 15px; }
    .cf-summary-value { font-size: 12px; }
    .cf-copy { gap: 8px; }
    .cf-copy-mark { width: 34px; height: 34px; font-size: 18px; }
}

.cf-film.is-paused, .cf-film.is-paused *, .cf-film.is-paused *::before, .cf-film.is-paused *::after {
    animation-play-state: paused !important;
}
.cf-film.is-still, .cf-film.is-still *, .cf-film.is-still *::before, .cf-film.is-still *::after {
    animation: none !important;
}
.cf-film.is-still .cf-status b::after, .cf-film.is-still .cf-ring::after, .cf-film.is-still .cf-morph i { display: none; }
