.animated-sub-widget {
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    padding: 1.25rem;
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.animated-sub-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: end;
}

.animated-sub-widget label {
    font-weight: 700;
    color: #334155;
    display: block;
    margin-bottom: 0.35rem;
}

.animated-sub-widget input,
.animated-sub-widget select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    font-size: 1rem;
    background: white;
}

.animated-sub-speed {
    margin: 0.8rem 0 1rem;
    padding: 0.9rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.animated-sub-speed label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.animated-sub-speed input[type="range"] {
    width: 100%;
    padding: 0;
    cursor: pointer;
}

.animated-sub-speed-notes {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.animated-sub-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.animated-sub-buttons button {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-weight: 700;
    background: white;
    color: #334155;
    cursor: pointer;
}

.animated-sub-buttons button:hover {
    background: #e2e8f0;
}

.animated-sub-working {
    overflow-x: auto;
    margin-top: 1rem;
}

.animated-sub-paper {
    display: inline-grid;
    grid-template-columns: auto repeat(var(--bit-count), 2.7rem);
    column-gap: 0.35rem;
    row-gap: 0.25rem;
    align-items: center;
    padding: 1rem 1.2rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    min-width: max-content;
}

.animated-sub-label {
    padding-right: 1rem;
    color: #475569;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.animated-sub-bit {
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    border-radius: 10px;
    transition: all 0.35s ease;
}

.animated-sub-borrow-row {
    color: #b45309;
    font-size: 1rem;
}

.animated-sub-borrow-mark {
    background: #fef3c7;
    color: #92400e;
    outline: 2px solid #f59e0b;
}

.animated-sub-line {
    grid-column: 1 / -1;
    border-top: 2px solid #334155;
    height: 0;
    margin: 0.25rem 0;
}

.animated-sub-soft-line {
    grid-column: 1 / -1;
    border-top: 1px dashed #cbd5e1;
    height: 0;
    margin: 0.4rem 0;
}

.animated-sub-current {
    background: #dbeafe;
    outline: 2px solid #3b82f6;
}

.animated-sub-borrow-from {
    background: #fef3c7;
    outline: 2px solid #f59e0b;
}

.animated-sub-borrow-to {
    background: #ffedd5;
    outline: 2px solid #ea580c;
}

.animated-sub-twos-row {
    color: #075985;
}

.animated-sub-carry-row {
    color: #64748b;
    font-size: 1rem;
}

.animated-sub-done {
    background: #dcfce7;
    color: #166534;
}

.animated-sub-changed {
    animation: bitPulse 0.65s ease;
}

.animated-sub-message {
    margin-top: 0.9rem;
    font-weight: 700;
    color: #334155;
}

@keyframes bitPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.18);
    }

    100% {
        transform: scale(1);
    }
}